Speeding Up WordPress Sites Using Contact Form 7 Plugin

Sakamoto Ryōma

Verified User
Joined
Jun 4, 2011
Messages
69
Hello everyone,

There are more than 5 million WordPress websites that use the Contact Form 7 plugin. The main speed issue with this plugin is that it adds its required CSS and JavaScript files to all pages on the site. They do this because if you have a newsletter subscription form in your site footer, the Contact Form 7 files need to be loaded on all pages. But what if you don't have such forms? It can slow down your website.

There's a quick fix for this by adding some code to the functions.php file, as shown in the example below:

Code:
if ( !is_singular() && !in_array(get_the_ID(), [65,99]) ) {
        add_filter( 'wpcf7_load_js', '__return_false' );
        add_filter( 'wpcf7_load_css', '__return_false' );
}

You can read further about alternative code options to use in the functions.php file on this blog.

Alternatively, we've created a tiny plugin called Rufo (Remove Unneeded Files of Contact Form 7) for those who don't want to bother with code.

Have a great weekend!
 
Very logical question. Actually, I submitted it to the WordPress plugin directory about a month ago (my blog about it), and last week they asked me to correct the ownership info. I initially wrote my personal name, but the plugin was uploaded to the company account. So I corrected it and resubmitted it to the WordPress directory. Once it is placed in the WordPress directory, I will remove my zip file and manage it through WordPress.org's system.
 
Very logical question. Actually, I submitted it to the WordPress plugin directory about a month ago (my blog about it), and last week they asked me to correct the ownership info. I initially wrote my personal name, but the plugin was uploaded to the company account. So I corrected it and resubmitted it to the WordPress directory. Once it is placed in the WordPress directory, I will remove my zip file and manage it through WordPress.org's system.
It is approved now, I will look at the requirements to use SVN in the weekend, and manage the plugin through WordPress.org

WhatsApp Image 2024-05-30 at 21.41.47.jpeg
 
please can anyone tell me how to increase the page speed of a WordPress website?
Theres a lot of tutorials in the web, here a short list:

Hardware-side: a fast server (SSD/NVMe) with serverside pache caching (Litespeed is faster than WP Rocket alone), opCache (PHP-files), object cache (ex. Redis for DB), fast /tuned MySQL settings (many provider limit the concurrent DB connections and make fast servers slower), optimize php.ini, gzip, use HTTP2/3 protocol

WP-side: see tutorials, basically: use caching, optimize images, block global scripts and load them only on sites where they are needed (example contact form 7), block bad bots eating your ressources, use few plugins, use few or none JS, better use CSS instead JS if possible, use serverside cronjob instead wp integrated cron, combine CSS and JS (attention please, check always website afterwards), prefetch DNS for external ressources, deactivate unneeded wp blogging functions, APIs, XML-RPC, lower the automated saving functions from wp, and so on. Check at least the first 2 tuturials in the list.

A few plugins to load plugins/scripts only on needed sites:

A few plugins to optimize / clean DB:
 

Attachments

Last edited:
please can anyone tell me how to increase the page speed of a WordPress website?
I'm being sarcastic here..... I'd ban WordStress.......yeah, emphasis on the stress.......... If you don't optimise the server for it, don't bother...... You even could have the perfect optimised server, however, if someone installed a bad or old plugin, that would affect a lot of things.

(People here know my hate for WordPress)
 
Theres a lot of tutorials in the web, here a short list:

Hardware-side: a fast server (SSD/NVMe) with serverside pache caching (Litespeed is faster than WP Rocket alone), opCache (PHP-files), object cache (ex. Redis for DB), fast /tuned MySQL settings (many provider limit the concurrent DB connections and make fast servers slower), optimize php.ini, gzip, use HTTP2/3 protocol

WP-side: see tutorials, basically: use caching, optimize images, block global scripts and load them only on sites where they are needed (example contact form 7), block bad bots eating your ressources, use few plugins, use few or none JS, better use CSS instead JS if possible, use serverside cronjob instead wp integrated cron, combine CSS and JS (attention please, check always website afterwards), prefetch DNS for external ressources, deactivate unneeded wp blogging functions, APIs, XML-RPC, lower the automated saving functions from wp, and so on. Check at least the first 2 tuturials in the list.

A few plugins to load plugins/scripts only on needed sites:

A few plugins to optimize / clean DB:
The problem is that whenever I install the Litespeed plugin or any other optimization plugin it slows down the website or breaks it

maybe I am doing something wrong. I am not an expert in WordPress.
 
The problem is that whenever I install Litespeed plugin or any other optimisation plugin it slows dow the website or breaks it
Without knowing your serverconfig and WP plugins, its hard to say anything. LS Plugin comes with several pre-settings, start with the minimal, then go up step by step. If the site breaks, compare the settings differences and find the culprit. Naturally, for LS Plugin you`d need a Litespeed Webserver environment. For other plugins, it can be too aggressive optimization settings, or conflicts with other installed plugins.
 
Without knowing your serverconfig and WP plugins, its hard to say anything. LS Plugin comes with several pre-settings, start with the minimal, then go up step by step. If the site breaks, compare the settings differences and find the culprit. Naturally, for LS Plugin you`d need a Litespeed Webserver environment. For other plugins, it can be too aggressive optimization settings, or conflicts with other installed plugins.
Can you tell me what to do from the page speed insight report? I cannot make sense of that report. I can give you the domain.
 
Pardon, i cannot becaue of time reasons. Its up to you to learn that. Or maybe another one here can help you further.
 
Contact form 7, slow sending because SMTP, it's time connect to smtp server (ex: smtp.gmail.com)
I have config relay in exim. Don't use smtp. I see it's the best solution for cf7 sending
 
Back
Top