Skip to content

Instantly share code, notes, and snippets.

@walterebert
Last active January 25, 2022 16:12
Show Gist options
  • Save walterebert/25c0d8b69a333e19f988555b4d2ced18 to your computer and use it in GitHub Desktop.
Save walterebert/25c0d8b69a333e19f988555b4d2ced18 to your computer and use it in GitHub Desktop.
WordPress snippet: Remove default DNS prefetch for s.w.org
<?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