Okay, just as FYI, both solutions “work” – but we are using the latter ( thanks @ramanan).
This works:
remove_action( 'wp_head', 'wp_resource_hints', 2 );
this also works, but seems way more specific, which is gooder! ??
function remove_dns_prefetch( $hints, $relation_type ) {
if ( 'dns-prefetch' === $relation_type ) {
return array_diff( wp_dependencies_unique_hosts(), $hints );
}
return $hints;
}
add_filter( 'wp_resource_hints', 'remove_dns_prefetch', 10, 2 );
Since this is specific to WordPress, should not impact external pre-fetch injections from mod_pagespeed, which we have off for upgrading at the moment so can’t test my original worry on the first example code.
??
WordPress really should have a toggle in the general setting “Use emojis” yes/no. For a blog about candy, sure. For a pure business news portal, not really needed.