Contact Form 7 Scripts and Styles on Every Page
With the complexity of websites, sometimes you cannot help but use a lot of scripts and styles. Even though you can cache and/or compress them, you want to limit what loads.
Scripts are the heaviest of files, and they do add a lot of load to a website. Speed is a factor nowadays, especially with Google. The faster your website, the better you will rank.
Contact Form 7
One of the most popular plugins in the WordPress realm, Contact Form 7 is one plugin that loads its scripts and styles on “every single page”. Frustrating for me, so I looked into solving this issue I had with it. Luckily, they have a solution for this right on their website…
This is a snippet from their page:
The best thing I can do here is to let you go to their page and follow their quick tutorial. A warning though, it does include some code work involving your website’s theme files. If you plan to do this, and if it’s a third party theme you are using, I recommend creating a child theme. This will allow you to keep your theme up-to-date without losing your changes.
However, if your website is using your own theme, then you can go ahead and edit the files (and your WordPress config file) by following their tutorial.
BACK-UP YOUR SITE before making any file modifications!
Test Your Site’s Speed
Just for the fun and curiosity of it, take a quick snapshot of your site’s load times with at least a couple online tools.
- GTMetrix – https://gtmetrix.com
- WebPageTest – https://www.webpagetest.org/
Make note of your scores, and then make your changes. Once done, check your load times again with the same online testing tools and then see how much of a difference it made.