Connect with us

Wordpress Tips

How to Add DNS Prefetching for External Domains in WordPress

DNS prefetching shouldn’t need any introduction to those of you who have studied how to make your website faster. It reduces latency and improves page load speed. It also improves browsing efficiency for pages that have multiple images, scripts and stylesheets. You can always use complex plugins to implement this to your website or write your own function:

Just add this to your functions file, and you are set. This code scans post content for external links and identifies their domains. It pre-resolves DNS for external services for external services, such as social media. It only works on pages where needed.

Continue Reading
You may want to check out:
*some of our articles and lists include affiliate links to fund our operations (e.g. Amazon, Elegant Themes, Envato). Please read our disclaimer on how we fund Exxponent.
You may also like...
Click to comment

Leave a Reply

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

More in Wordpress Tips

To Top