What is DNS-Prefetch?
DNS prefetching attempts to resolve domain names before a user tries to follow a link. It is done using the computer’s normal DNS resolution mechanism.
The main reason rel=dns-prefetch exists is to speed up the way web pages load when they use different domains for page resources. This process is often called “DNS prefetching“.
The WordPress link looks like this:
<link rel='dns-prefetch' href='//s.w.org' />
Remove WordPress DNS-Prefetch with WP Ghost
To remove only the WordPress DNS-Prefetch link from metas with WP Ghost, follow these steps.
- Access your WordPress dashboard after installing and activating the WP Ghost plugin.
- Go to WP Ghost > Tweaks > Hide Options.
- Switch on the Hide WordPress DNS Prefetch Meta Tag option to remove the WordPress DNS Prefetch Meta.

Note! WP Ghost will only remove the WordPress DNS Prefetch and not remove other DNS prefetch and will not affect the website loading speed.
Remove DNS-Prefetch with Code
To remove the DNS-Prefetch links from WordPress wp_head hook is not very hard.
You can add the following code to your functions.php to remove DNS-Prefetch link from your header:
add_action( 'init', 'remove_dns_prefetch' ); function remove_dns_prefetch () { remove_action( 'wp_head', 'wp_resource_hints', 2, 99 ); }