Are external scripts slowing down your WordPress site?
These are anything that pull information from outside your website: Google Fonts, Analytics, embedded YouTube videos, job postings, Gravatars, even comment and social sharing plugins.
You can optimize external scripts in WordPress by hosting files locally (fonts, analytics, Facebook Pixel), selectively disabling scripts using the Asset CleanUp plugin, and adding browser hints like preconnect and prefetch. Some plugins and scripts (eg AdSense) should generally be avoided if speed is important to you. Whatever is left over, determine whether the sacrifice in performance is worth it, and whether you should delete it or find an alternative.
External scripts almost always show errors in GTmetrix under Reduce DNS Lookups:
Here’s how to optimize third party scripts:
1. Find External Scripts
Run your website through GTmetrix (the tool I recommend) and look at your PageSpeed and YSlow tab. If you expand items and see the same external script (or plugin) showing multiple times throughout your report, that probably means it’s slowing down your WordPress site. You can also use the GTmetrix Waterfall tab to find out how long each resource takes to load.
Query Monitor lets you see your slowest loading scripts, styles, and plugins:
2. Disable Unused Scripts, Styles, Plugins
Some plugins load across your entire website regardless of whether they’re
This article was written by Tom Dupuis and originally published on Tom Dupuis.