Jan
1st

WordPress: Related Post Tweaking

If you’re using WordPress, one of your required plugins should be the Related Post plugin. That said, I noticed that the volume of keywords that were being posted with my Daily Reads were really skewing the Related Post results.

As well, I was really surprised that the Related Posts plugin only provided a list of related posts before the post that you’re reading! What if you changed your mind (as I often do!)… shouldn’t you also provide posts that were released after the original but still related?

As a result, I made some minor tweaks to the plugin. First, in order to reference posts both before and after the current post, I modified line 91 from:

. "AND post_date <= '$now' "

to (UPDATED: 1/31/2008):

. "AND post_date != '$now' "
. "AND post_date <= CURDATE()"

Second, the Daily Reads on my blog are posted automatically by Del.icio.us under a specific Author (so that I'd never change the password and break the automated posting). To do this, I just added another query parameter to omit that author from the posts that were searched by inserting the following line after the previous:

. "AND post_author != 4 "

I found the author number simply by looking it up in my Users. I'd rather not make things complicated by joining to another table - it could reduce the speed at which these results are displayed and slow down the load time. That will lead to folks getting frustrated and leaving.

The Benefits of Displaying Related Posts

Related Posts is a fantastic tool for any blog. Related posts strengthen Search Engine Results by magnifying the keywords through links, an important element of Search Engine algorithms.

Related posts are not just a SEM tool, though. Related posts are a retention tool that will keep users in your site. They may not find what they were looking for where they landed - but if you provide them with additional references, they may stick around!

You might also find these posts interesting:

  • Great post, I will do the tweak on my plugin thank you again!
  • One thing I should say; I do think Doug's hack would be a good addition to WordPress, at least as a user option. It does seem rather silly to limit related posts to only those that came before.

    ALSO, I would like to ask Doug to post about how his daily posts are posted from del.icio.us; that would be an interesting topic.
  • Hi Mike!

    I agree with you... and here's how to do the daily posts from Del.icio.us. Enjoy!
  • Heh. Good one! I guess I should have googled for it first.

    BTW, I sent you a personal email about me being in Indy Feb 16-19 about a week ago but have not heard back. Did you get? (feel free to delete this part of my comment.)
  • @Mike: Well, I guess that’s the difference between someone who is viewing programming from perfective of profession and a craft vs. someone who is a practioner just trying to get something done

    Interesting distinction. While it would be nice to have everything running at the absolute best it can be, in many cases that seems impractical. I strive to find a balance in my programming between how I would like something to run and how much $ or time it will take to get it there.

    I strive to do the minimum it takes to accomplish the purpose I'm try to achieve. To spend more time would not be cost effective.

    In short, unless that loss in efficiency was noticeable in my blog I would not spend the extra time, If it's noticeable than I would decide whether the additional time would be worth the result. Perfection is not always the best solution.
blog comments powered by Disqus