High CPU usage on WordPress? Reduce your post tags!

Share This: Tweet about this on TwitterShare on FacebookShare on Google+Share on LinkedIn

Traffic downHigh CPU usage again – yeah this problem seems to never go away if you have a WordPress blog and been hosting it on a shared account.

After I moved to HostGator a couple of years ago, I thought I would never see this problem any more until my account was suspended temporarily last Friday.

The HostGator administrator who helped me by giving me the general tips (that we all know anyway – make sure you check my WordPress optimisation guide) but also in specifically pinpointing that I have 3,000 WordPress tags that are being used by my related posts plug-in. This definitely increased the overhead on the server as the plug-in needs to analyse my tags to display the related posts.

There was also a problem of my W3 Total Cache wasn’t running properly, because I use the Disk:Enhanced for the Page Cache settings. The administrator then set it to Disc: Basic (though I could do it on my own).

As for the WordPress post tags, I managed to cut them from 3,000 to 300. Yes, that many! Took me hours to optimise that one though it was a good excuse to clean up and optimise my post tags.

You might want to do some clean-up as well to speed up your blog and to avoid problems in the future like mine.

How to reduce and optimise WordPress Post Tags

1) Clean up all unused WordPress tags or tags that are only being used by one or two posts.

Do this by going to the WordPress Administration screen and click on the Posts-Post Tags. You should be able to see all your post tags. Go to Screen Options and put 200 (or more) Post Tags to be displayed so you can process more tags in one go.

On the list of tags and the number of posts, click on the “POSTS” to sort them from least to most. Then tick all the way through and delete the tags that are only being used by a single post.

I’ve seen a database SQL query than can do this nicely in one swoop. They are quite risky though and I didn’t dare to do it, simply because WordPress has made some changes on the recent versions, so I didn’t want to screw up my database.

OR EVEN BETTER:

2) Merge similar tags into one with the help of a plug-in

With the help of a plug-in called Term Management Tools, you can merge multiple WordPress post tags into one. After the plug-in activation, go to the same screen (WordPress Administration-Posts-Post Tags) but this time, notice there’s a new “Merge” menu on the drop down list:

WordPress Merge tags

Select multiple tags and then apply the Merge to combine them. For example, I combined all my Samsung related tags into “samsung” here:

merging tags

Apparently I found tons of useless tags (tags that are too specific) and this issue helped me actually to pinpoint and optimise them further. Tags like “Firefox 3.2”, “Firefox 3.5” can be combined into “Firefox”, for example.

As of now, things seem to go back to normal. Glad I can still host this blog on HostGator shared account even with 5,000 visitors a day though that day may hopefully come where I have to move to a dedicated hosting.

Share This: Tweet about this on TwitterShare on FacebookShare on Google+Share on LinkedIn
The following two tabs change content below.
A technology enthusiast, blogger, gamer, and reviewer. Proud owner of Craving Tech

Latest posts by Michael Aulia (see all)

  • http://techlunatic.com Rohan

    The next time your wordpress troubles you, feel free to move it to my hosting account!

    I cant see you in trouble man!

    (….and don’t forget to push the domain to my name too)

    • http://www.cravingtech.com/about/about-me Michael Aulia

      Hehe thanks, Rohan. Will think about it

  • http://mytechquest.com Steve Yu

    My blog was temporarily suspended too last Sunday by Hostgator. Later the issue was settled after I’ve removed the All in one Seo pack plugin and replaced it with another SEO plugin (that hostgator admin recommend).

    • http://www.cravingtech.com/about/about-me Michael Aulia

      Oh? I wouldn’t think of All in One SEO pack making a ruckus on the server.. glad that the administrator could point to that, at least (rather than “reduce your plug-ins” general kind of advice).

      Did he say why you should change and what the other SEO plug-in is?

  • http://techwalls.com/ Tuan @ Technology Blog

    Hi Michael,
    Are you using any CDN service on your site? I think the service could help reducing requests to database on HostGator.

    • http://www.cravingtech.com/about/about-me Michael Aulia

      I’ve already been using CloudFlare though I turned the Security Off though. Some bad bots might be hammering my site? I turned it to Low after I got this suspension just in case

  • http://www.torymcbroom.com Tory

    I have disk enhanced set up on all of my blogs. Did the administrator say why it should be basic?

    • http://www.cravingtech.com/about/about-me Michael Aulia

      Hm didn’t really say specifically on why. This was his email:

      “I noticed that while you have W3 Total Cache installed, it was set to enhanced and not basic caching so it was not truly caching your content. Additionally your site has over 3,000 tags which are used by several of your plugins. “

  • http://www.techaddition.com/ Daniel @ Tech Addition

    3,000 tags are definitely too many. I always prefer to add tags which i think are important.

    • http://www.cravingtech.com/about/about-me Michael Aulia

      Yeah, I never knew how to use tags (and I guess I’m still not using it efficiently). I guess the related post plug-in I’m using (nRelate?) is comparing the post tags to find relevancies

  • http://www.theindianboy.com Abdulqader Kapadia

    Hey Michael! I never new too many WordPress tags could lead to downtime. These are some great tips.

    I use “categories” as a parameter for showing related posts (not via plugin, only custom code).

    • http://www.cravingtech.com/about/about-me Michael Aulia

      Ah, gotcha. I think tags can be more specific as categories can be very generic (for example my “Gadget Reviews” category can cater for keyboard, mouse, and even some weird mini gadgets!

  • http://bestfattyliverdiet.com Derek Blandford

    Hey Michael,

    I tend to use only 2 or 3 tags per post. I like to keep everything highly targeted. I didn’t even realize it could cause problems with CPU usage. So far no problems. Let’s hope it stays that way.

    • http://www.cravingtech.com/about/about-me Michael Aulia

      I always use 2-3 tags too but they often were too specific. For example I put tags like “windows 7 installation problem”, “windows 7 sleep issues”, “windows setup cd problem”. That’s why I ended up having 3000 tags :D lol

  • http://techtrickz.com JK@techtrickz

    Thanks for sharing this useful tips. I am sure it’ll help me in near future.

  • http://technicallyeasy.net Paul Salmon

    I just started to make use of the post tags, but have tried to keep things more generic where I can. I don’t think I am even close to 300 let alone 3,000, so I probably don’t have much to worry about, yet.

    This post has made me ensure that I don’t create too many tags – or at least use them within my related posts plugin.

    • http://www.cravingtech.com/about/about-me Michael Aulia

      Yeah, it’s a good warning to all of us, I guess. I have around 300 tags now and I tend to keep it less than 400 from now on!

  • http://www.bethanybaptist.net BB

    I was always under the impression that the more tags you used the better, but didn’t realise this could be a problem as far as CPU usage goes. Some of the things I’ve had to do recently are block certain bots to my server and used CloudFlare for its CDN (Content Distribution Network) abilities to reduce server load. Will definately look at removing tags that are only used by one or two posts, great tip.

    • http://www.cravingtech.com/about/about-me Michael Aulia

      I guess it may become a problem if you have a plug-in or code that makes use of tags (by searching, retrieving, comparing, or processing tags similarities as these processes will take up some CPU usage definitely!)

      I’ve been using CloudFlare and caching plug-in too and this problem still occured, so you might want to be careful too

  • http://extraordinaryfigures.com Khleo Thomas

    I use a lot of tags to hopefully get noticed by the search engines. Will getting rid of them hurt my SEO?

    • http://www.cravingtech.com/about/about-me Michael Aulia

      Not too sure, I’m sorry. I’m always under the impression that tags and meta keywords don’t matter for SEO. Most bloggers even suggest to block the tags from being indexed as it may lead to duplicate posts

    • http://techstyles.com.au Scott Fitzgerald

      Google really doesn’t think much of tag pages. It regards them as no better than search results pages. I think it’s best these days to think of tags as help to user navigation more than building up a page count with a view to it helping SEO.

      I too have had CPU issues, and whittled down my tag pages from 700 to under 300, and deleted some memory-hog plugins. Next step is to try to have my host increase my memory allowance, up from 32M.

  • http://rahulbuzz.wordpress.com Rahul

    Well why don’t you go for VPS or reseller on hostgator. Your websites is too big and heavy. Even you use lot of ads and plugins. I think this is time to switch for modification of hosting.

    • http://www.cravingtech.com/about/about-me Michael Aulia

      I was thinking about it but I just don’t want to be bothered with having to install and configure everything by my own. Just don’t have the time to install and tinker around with Linux (though I know my way around Linux a bit)

      Dedicated hosting would be better but it’s so expensive

    • http://rahulbuzz.wordpress.com Rahul

      Well you can raise ticket on hostgator. I hope they will take your data to reseller or vps. So, you don’t need to do any thing. As i am using reseller and i have 50-100 sites. But i don’t get traffic as much as you. And none of my sites is to big except few.

      Just adsense and amazon.

    • http://www.cravingtech.com/about/about-me Michael Aulia

      Wow 50-100 sites? Awesome!

  • http://www.webtrickz.com Mayur

    wow.. 3000 tags are just too many. I don’t have such issue as the site is on VPS and powered by MaxCDN. Still I followed your advice and deleted around 350 useless tags which all were linked to just a single post. Thanks for the tip. :)

    • http://www.cravingtech.com/about/about-me Michael Aulia

      Ah.. VPS + MaxCDN = good combo.

      Glad you can at least benefit from optimising your tags from this post :D

  • Jake

    The number of tags in my wordpress site is not that huge though. I usually use general tags so i never experienced something like this. I never thought that having this many tags could increase dramatically the overhead cost of the servers. Thanks for pointing this out.

    • http://www.cravingtech.com/about/about-me Michael Aulia

      You’re welcome. I never thought about this as well. I guess it’ll be okay if you don’t use any plug-ins that make use of your tags

  • http://techlogon.com Roy

    Good points Michael, wouldn’t have thought of optimizing tags. My own were a rather paltry 300 but I have now reduced them by 20% anyway as I use a related posts plugin – you’re right that the single post tags are usually too specific to be of future use.

    I would have thought VPS was definitely the way to go though if you have 5000 visitors a day?

    • http://www.cravingtech.com/about/about-me Michael Aulia

      It’s kind of funny that many commenters here are using around 300 tags and here I am, optimising all the tags to 300 as well. Must be some magic numbers for bloggers :)

      Hm, so far it’s been okay when I asked them again about my usage. I guess I would need to move to a VPS pretty soon

  • http://invicta-watch-reviews.com Nicolas

    It never dawned on me using tags would effect server usage – guess I didn’t think about the related post feature. I still hear though from reputable SEO guys that using specific tags is still a good practice. Guess it is a trade off between the SEO benefit and the site speed, although for most sites it won’t be an issue until we have traffic numbers like you do. :)

    • http://www.cravingtech.com/about/about-me Michael Aulia

      Well, one day you’ll definitely have that kind of traffic, if not more :) Everyone will have to come from somewhere, right?

  • Jade

    Great tips! Just be here by chance in google & bookmarked, but for me I still wonder about what different between Banwidth Usage and CPU Usage. I have a blog as a band and allow my visitor to download my mp3 music directly. Does it affect with my shared hosting account bandwidth or cpu usage? I’m in Inmotion Business Class Hosting. Anyway nice site!

    • http://www.cravingtech.com/about/about-me Michael Aulia

      Downloading/uploading is more like a bandwidth usage as data needs to be transferred back and forth from their servers to whoever browse/download the mp3

      There is definitely a cpu usage to serve these files but it will be minimal compared to the bandwidth in your case

  • http://www.etectips.com Sean

    I am getting the same problem. I was banned by my previous hosting provider. Even I got better one now, my site usage is twice the amount of CPU. My problem is similar to your. I hope it is going to work for me.
    Thankyou.

  • http://www.namase.com/ Rajesh Namase

    Use CDN service, or try CloudFlare.

  • http://www.jokesmantra.com manish

    Please Suggest Me The Tips For Reducing CPU Usage In WordPress Blog. Is Facebook Plugin And Related Post Plugin Get High CPU Usage??

  • http://www.jokesarcade.com Adil

    I have used cloudflare to reduce CPU usage… it work like champ