Remove Contact Form 7 to Speed Up WordPress Blog

Written by Pavan Kumar on May 25, 2009

Advertisements

I am not a coder and hence don’t comment on plugins regularly. I don’t identify the bugs so easily as php experts do. But I can notice things which a normal website visitor can identify and report such bugs like it was done in the case of duplicate content issue and in that case, I could find out solution too. Stumble for WordPress is such a rare and useful plugin and it does not have any alternatives – which made me think about solution. Now, we have alternatives in this case.

Regular readers here know I have tweaked my theme to a considerable extent and the sole reason behind was to improve the speed and performance of website. During this, I identified many factors which simply overloaded my site and made it slow. Till then Contact Form 7 was used at the contact section. Analyzing it deeply, it was found to create useless dead weight to download which makes the website much slower on low speed internet connections.

Slow performance of website caused by wordpress plugin

Coming to the calculations, one plugin called Contact Form 7 used to put an extra load on each and every page of blog and that total unnecessary downloaded content summed up to 66.9 kbytes. It includes 3 javascripts (two versions of jquery javascript files, one plugin javascript, one plugin CSS). On calculating properly, this extra load will take 5 seconds on a 128kbps connection. We should not forget the fact that even in today’s high speed world, there are many people using internet connections at 56, 128 and 144 kbps connections. Users of slow internet connections simply quit your slow website and start googling for any alternative.

Solution

If you ask me, remove the plugin. There are many other plugins available for same purpose which will not put dead weight on your blog pages.

Analysis with YSlow Firefox Addon on Life Rocks 2.0.

       

Subscribe to RSS Feed or Get updates on your inbox:

People who liked this also read:

33 Readers responded to this post

nice observation! Another similar plugin is “Users online” which is suppose to show the number of users currently browsing the website, but it adds so much redundant data, I had no option but to remove it

The analysis might be correct, I can still reduce the load on my website with zero plugin, but that does not server my purpose. So I used this plugin which served my purpose best

I’m using users online and contact form and my page is very slow :/
but can you tell me please some alternatives to these plugins? it would be very helpful!

thanks

@ Raju

Not just it consumes resources, also it eats up a lot mysql…

@ Nirmal

May be for you, as it supports many contact forms to be added. For my purpose, I only have contact form on contact page and I don’t need that massive plugin for that purpose.
I just took your blog for analysis as I saw you used it. My intention was not to point / comment you πŸ™‚

@Fotodepp

I took a look at your blog. In deed its bit slow and there might be many reasons. As you asked for alternatives – here are those.

For contact form 7: http://wordpress.org/extend/plugins/wp-contactform/ This is not a great plugin, but server the purpose without any load on page / server
For online users: http://whos.amung.us/ This reduces server load by maximum extent.

I also observe the call for prototype.js twice on your blog. It basically is a very heavy js file of 125kb. Your home page itself is 555kb – more than 0.5 MB, just imagine, your blog home page loading is almost like downloading a software. If you don’t desperately need it, change the theme to some simple one.

I had a similar issue with insertion of prototype and other scripts, found the problem to be in the Lightbox 2 plugin, have disabled it now since I am better off rather than using 150Kbs of javascript on the blog right, it’s too much for a small functionality Lightbox provides users with.

@ Keith

Thanks for the useful inputs.

@ Fotodepp

Even you are using lightbox plugin… If you feel its not of great use, you too can remove it as Keith did.

Hey,

thank u for ur comment!

i will activate the plugins u recommed soon, thanks for this!

i dont think, that the prototype.js is a file of the theme…its still loading on other themes, but i dont understand this javascript code so i cant discover the reason why loading…i think its a usefull plugin, like statpress or all in seo or something..i dont know πŸ™ i will ask some specialist.

thanks guys!

Great observation pavan. If you can come up with some nice alternative to this plugin that will be great too..

I think kontactr is best for using contact forms. I was using it on blogger but after moving to wordpress I started using contact form 7.

Hmm, wonder what is the logic behind loading the script with every blog post/page rendering… I use wp-contact-form and I am quite happy with it.

I Use CForms, the best part of it is that I can limit the scripts to only load on certain pages, rather than the whole site.

Cforms however is a bit complicated when you start out with it, however it is definitely the contact form I would recommend everyone here.

@ Harsh @ Ajith
I am now using WP Contact Form – quite better with resources and all.

@ Simran,
Never tried that, it looks good on its demo page. If it does not have any ads on them, its the very alternative as we can reduce one more plugin on blog πŸ™‚ Thanks for sharing

@ Keith
Never tried that too, but now I am more liking kontactr πŸ™‚

@ Simran,

kontactr does not look good at all.

@ Pavan
kontactr is ad-free…

Even I’m using the Contact form 7 will take a look at the resource usage now.. Will try to remove it. Thanks for the share..

@ Gagan

I think functionality is important for such less accessed pages like contact page, I found the popup type contact form on the kontactr demo page which looked good.

@ Simran
That’s a good thing to hear. Thanks for info.

@ Samrat
I observed most of the bloggers use the same plugin and hence wrote a post to spread the word. Contact form 7 is that high popular and google always ask you to use the same always for many related search terms like “wordpress contact form”, “contact form plugin”, “contact plugin” etc.

@ Gagan

What you don’t like in kontactr ??? It looks better… Simple and Easy to install

Hey dudes,

thanks for the suggestion, but i dont have installed the Lightbox Plugin. πŸ™ i dont know what the hell prototype.js do πŸ™ can anyone help me plz?

i googled and found only this: http://www.longren.org/2007/02/19/wordpress-and-prototype/ to load the prototype.js once and prototype.js handle something with ajax..but i deactivatet all ajaxed plugins but nothing changed πŸ™

@ Fotodepp

What I observed with you blog is the blog theme which is calling prototype.js. Even I am not an expert, but I work trial and error way and that’s how I worked with this existing theme on my blog.
Coming to your blog, open theme editor in wp-admin and open header.php for editing.

Now, search for prototype.js in your browser internal search and you will be navigated there. Now, comment them ( use to end commenting) and test if your blog works fine. If your blog succeed to load without them, you have just reduced .25mb of your page size.

The lightbox.js as I said above was due to wordpress flickr manager plugin.

Its in the wp_head() tag. πŸ™ but where can i find it? … plz tell me πŸ™

hey, how can i create a form like this here? i just click in the field and my name,mail,url(with cookies) will be displayed..tell me how please πŸ™‚

@ Fotodepp

Not in wp_head(), I don’t know about editing very complex themes like those with child theme. May be your theme designer would help if they are kind.

Coming to my comment section, here is what I have used in my codes…

Hope this helps you πŸ™‚

Update: Refer to following comment.

@ Fotodepp

Sorry for previous comment – it treated it as html and went wrong, you can find my code here: http://txtb.in/2Pp

Great post, Actually i am also user of contact form 7. Well will you tell me the name of plugin which will be best for my blog??

@ Rajesh,

I currently am using “WP Contact Form” plugin, and Ajith who commented above is also happy with the same.

hey,

just want to say, that i found a other way to include the prototype. it loads faster – i think.

google.load(“prototype”, “1.6.0.2”);

just paste this in the head

via

Damn, didnt works. here the code:

http://txtb.in/2ZM

@Fotodepp

Did you try to add the source code link directly? Its given in noupe itself..

But before adding this one, first you need to remove the existing one from loading and then add this code. If you just add this code without removing the older one, your site will get much slow 😐

What you mentioned here is true for most of the plugins that require javascript.
A quick solution I use is to manually load the javascript files only on the pages that require them, with just a bit of php.

(only pseudocode below, not php)
if current_page_id = 56 (or whatever page ID is the contact page)
… the js and css links for the contact form
end

and I remove the js & css calls from the plug-in, such that it won’t load in the wp_head anymore.

Hope it will help you keep this plug-in without heavy js being imported on all your pages.
Goodluck!

@ Mehigh,

I understand you coders, developers can do whatever you want πŸ˜‰ but unfortunately I am not a code πŸ™ so, if I mess up, that will be a huge problem. I hope your comment helps other visitors on my blog πŸ™‚

Thanks for sharing and welcome here πŸ™‚

Hey Pavan,

I’ll try to give you a few hints, such that you would easily do this in the future (maybe even write an article after you do it “hands-on”).

1st, when you look in the source code of the page you will see comments around the imported files from a particular plugin:

Copy paste this links into a new file.

Now go into the plugin’s folder and look for wp_head, usually at the end of the plugin .php file there will be a line that ‘adds up’ the plugins CSS & JS files to the header of WordPress.
Just comment this line and you will notice there will be no more CSS & JS from this plugin anymore.

Take the CSS files that are imported, use a CSS Compression utility http://www.cssdrive.com/index.php/main/csscompressor/, compress them and add the styles to the end of your theme’s style.css file. Now since they are imported the styles in the main style.css, you won’t need to worry about the css links, but what do we do with the JS file ?

Now let’s move to the header.php from your theme file
post->ID; ?>

3675 is the page ID where the first js file is needed.

Now that will be the only one loading it.

You can get your pageID either from the wp-admin, or by simply looking at the source code of a link pointing towards it (it has a class similar to: page-item-3675), you take the number and stick it in your if clause from above.

Does this look scary ? Just back-up your wp-content folder before you get your hands dirty and you will be able to go back one step in case you break anything… then try again.

Good luck,
Mehigh

The code got scrambled, so I added to pastebin, check it out here:
http://mehigh.pastebin.com/f5830a146

@ Mehigh,

Nice workout buddy, will try it soon on localhost installation, thanks πŸ™‚

3 Blog responses for this post
Leave Your Comments Below / Trackback

About The Author

    Pavan Kumar

    Pavan Kumar completed Engineering in Electronics and Communication in the year 2008. He is very enthusiastic and keen to work on different aspects of computer, internet and mobile related fields. The articles here reflect his creativity. This blog was started as a showcase of solutions for different problems and today it has got a good reputation in the blogosphere. Read More...

© 2024 - TechPavan.com. All rights reserved.

All content provided in this site are the property of TechPavan.com and is free for non-commercial usage. Read our Privacy Policy here.

Any kind content on this site cannot be reproduced in any form without permission of the author. We are not responsible for any loss or damage which may occur due to any of our content.

Site hosted on Bluehost powerful servers.