1. Home
  2. WP Hacks
  3. WP Tips

[How To] Remove DNS-Prefetch Links Without Plugin

How2Buy // (Updated: )

Removing DNS-Prefetch from wp_head hook is a pretty easy task. Just add the following code snippet to your functions to remove DNS-Prefetch links on your header;

// Remove dns-prefetch Link from WordPress Head (Frontend)
remove_action( 'wp_head', 'wp_resource_hints', 2 );

What is DNS Prefetch?

DNS prefetching is an attempt to resolve domain names before a user tries to follow a link. This is done using the computer’s normal DNS resolution mechanism; no connection to Google is used.

1 Comment

Leave a Reply

Your email address will not be published. Required fields are marked *

Share Share Tweet