Last active
January 25, 2022 16:12
-
-
Save walterebert/25c0d8b69a333e19f988555b4d2ced18 to your computer and use it in GitHub Desktop.
WordPress snippet: Remove default DNS prefetch for s.w.org
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( | |
'wp_resource_hints', | |
function( $hints, $relation_type ) { | |
foreach( $hints as $k => $v ) { | |
if ( strpos( $v, '//s.w.org/' ) ) { | |
unset( $hints[$k] ); | |
} | |
} | |
return $hints; | |
}, | |
10, | |
2 | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment