WordPress Wednesday: Efficient Related Posts

August 5, 2009 · 1 comment

in Wordpress

WordPress is a great blogging platform. And because it’s built on PHP, it’s possible to include lots of dynamic code that gets evaluated and run whenever one of your website’s readers loads a page.

Too many such dynamic elements, though, and it can seriously degrade your site’s performance, especially if those elements require complex database access. A case in point is any plugin that calculates related posts ‘on the fly’. The more posts your blog has, the longer any such calculation would take. And given that every reader will be shown the same related posts information, recalculating that information on every page view doesn’t make much sense.

A caching plugin (for example, WP-SuperCache) would help, but it makes more sense to maintain the related posts links in the database, and only recalculate the network of links when posts are created or edited.

That’s the intention behind Efficient Related Posts. Every time you create a blog post, the plugin will store links to other posts — so when you view the post page, no expensive recalculations have to be made.

Of course, if you calculated related posts only for new posts, the only links that would be created would end up going to older posts. Efficient Related Posts gets round that problem by selectively recalculating other posts’ links too. So if you create post A and the plugin determines that it’s related to posts B, C and D, those three posts’ related links will get re-evaluated.

In a blog with thousands of entries, there’s a possibility that the evaluation loop could cause some serious delays. At least by containing those delays to the admin side, your readers will gain the benefit of the related links without any delays in their preparation.

Related posts:

  1. WordPress Wednesday: Custom Post Limits As I’ve been using WordPress more and more for blogging,...
  2. My top 5 WordPress plugins Earlier today, Tim Ireland (@bloggerheads) asked over Twitter: Hello, hive-mind....
  3. New Rails feature: simply_helpful UPDATE: Thanks to everybody who’s linking to this blog post,...
  4. Expirations So I’ve been thinking lately that I should scrap this...
  5. Essential reading for online journalism As usual, Martin Stabe is the guy to go to...

{ 1 comment… read it below or add one }

Chet Payne June 17, 2010 at 10:59 pm

I just download and an trying this now. Impressed so far. Thanks for the explanation!

Reply

Leave a Comment

Previous post:

Next post: