For a long time i’ve used on my wordpress blog plugins to display related posts at the bottom of the content, but some days ago I’ve noticed of a certain slowness of my websites, somethings like 20-30 seconds to generate post preview, browsers error while post charges.
I thought that was a hosting’s problem, and really was. After 2-3 days Hostgator solved that problem, but blog was also slow, very slow.
Yesterday i found this article from Stefano Garuti where he spoke about “related posts plugins”. He write about the same problems i had on my blogs: Timeout when he try to save draft, or publish post or try to generate post’s preview.
How Related Posts plugin work?
Usually a related posts plugin, get a query from the database, doing a cross analysis on tags and categories, then generate the cache and finally show the post with the related posts.
The Problem:
When you create a Post preview, try to publish a post or try to save draft, this plugins try to generate cache, usually needs 2-3 seconds, but when the post come to 100-200 he needs such as 20-30 seconds.
So wordpress goes Timeout. In my case i retrive also a database error connection.
The Solution:
Thinking about the problem i try to remove “related posts” plugin, and magically problems disappear. I think that when your blog have a little number of post you can use this kind of plugin, but if you have 100 -200 posts (and simply shared hosting) you may think to disable it.
Actually i’ve solved any problems and the blog speed is normal, so the real reason of the blog’s slowness is the plugin.
Conclusion:
I know that the relate posts plugin sometimes can be very important to let your visitors on blog, but when there are this kind of problems i think the best solution is completely remove the problem.
