Skip to content

Instantly share code, notes, and snippets.

Last active December 14, 2018 09:26
What would you like to do?
Remove "type" from script/style Tags
add_filter('style_loader_tag', 'codeless_remove_type_attr', 10, 2);
add_filter('script_loader_tag', 'codeless_remove_type_attr', 10, 2);
function codeless_remove_type_attr($tag, $handle) {
return preg_replace('/ type=[\'"]text\/(javascript|css)[\'"]/', '', $tag );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment