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.












