Wordpress Tutorial – Adding Similar Posts

November 23, 2008 by Andy 





Wordpress is a fantastic platform for creating affiliate sites.  One of the things I get asked about a lot is how to add a similar posts section to your pages. 

Similar posts have a couple of benefits for your site. 

  1. Add relevant content to the end of your posts, highlighting other relevant content your visitor may be interested in.  This increased the stickiness of your site, keeping visitors on site.
  2. Linking to other relevant content can help boost your search engine rankings.  Not only does the page linking out get a boost (because the search engines love this type of relevant linking), but the pages being linked to get a boost, as they receive more incoming links.

Similar posts is easy to implement using a Wordpress plugin called “Similar Posts”.  Install it like you would any other plugin.  If you need help, read my tutorial on installing Wordpress plugins.

Once installed, you’ll have access to a number of Similar Posts options in the “Settings” menu.

similar-posts

There is a menu across the top that you can explore, but the one setting I think you should enable for SEO purposes is the one in the screenshot below:

similar-posts-2

Making sure that the similar posts “Match the current post’s category”, will mean that the similar posts will all be related to the page they appear on.  If you do not enable this option, you will have links to unrelated content appearing in the list.  You might want to explore the “Output” menu as this will give you options on how your similar posts appear.

similar-posts-3

OK, with similar posts installed and ready, you now need to add some code to your templates.

The exact template you need to edit depends on your template set.  Have a look at the Wordpress template hierarchy diagram.  This will tell you which template is responsible for which page on your site.  e.g. to add similar posts to a post page, that diagram tells you that you need to edit the single.php template if it exists, and if not, either create that file using the index.php as a “template”, or just edit the index.php file.

Edit the template in a text editor, and add the following code to the template at the point in your page where you want the similar posts to appear:

<?php similar_posts(); ?>

Here you can see it in my Affiliate Minder site’s index.php template:

 

similar-posts-4

You will notice that I have added an H1 header right before the similar posts will appear.  This is what my final page looks like in a browser:

similar-posts-5

 

The most difficult part of adding similar posts to your page is to find the right point to insert the similar post code into your template.  Don’t worry too much about this.  Keep a backup of the original template, and play.  After uploading, if the template is screwed up, or the posts do not appear where you want them, simply restore the backup and try again.

Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Blogosphere News
  • Furl
  • LinkedIn
  • Live
  • Ma.gnolia
  • MySpace
  • Reddit
  • Slashdot
  • Spurl
  • StumbleUpon
  • Technorati
  • Yahoo! Buzz
Print This Post Print This Post

Related Articles

  • Wordpress Template Hierarchy - Wordpress template system is confusing for those new to Wordpress. There is a simple hierarchy of templates that explains why some templates have certain files, while others do not. Share and Enjoy:
  • Creating Custom sidebars in Wordpress - Have you ever wanted to have certain ads only show if the sidebar of certain pages? Wordpress uses a template system that means every page uses the same sidebar, but we can add code to the sidebar to test if a page is in a certain category and then insert code if it
  • Wordpress 2.7 Preview - Since I am using Wordpress almost exclusively for building my own affiliate sites, I decided to join the Wordpress 2.7. beta testers so I could give you a quick overview of what is coming.  What I cover here is only a small part of Wordpress 2.7., and represents what I found interesting in the hour
  • Using Widgets In Wordpress - Widgets allow Wordpress users to easily add in new features to the sidebars of their templates without having to hack template code. e.g. you can add a translator widget that will translate your page into multiple languages, or you could add a Feedburner subscription box.  Adding both of these (and the hundreds of other widgets
  • Wordpress Tags – Uses and Abuses - Wordpress tags are often abused and the consequences can be bad. Learn to use Wordpress Tags effectively. Share and Enjoy:
"The Money Is In The List"

AWeber proves it to thousands of businesses every day.

Learn how email marketing software
can get you more sales, too.

Comments

9 Responses to “Wordpress Tutorial – Adding Similar Posts”
  1. Jim says:

    Andy

    I’ve just started reading your WP tutorials and they are very informative, I’m wondering if there is a recommended order to view these for someone new to WP. Where to start and a logical progression as you put a WP blog together?

  2. Andy says:

    Hi Jim
    There really isnt an order with these, just short tutorials on all aspects of Wordpress. I have setup my Wordpress for Affiliate Sites membership site for those wanting step by step videos and turtorials. You can read more about it at: http://improdigy.com. There are a couple of members websites in the showcase link so you can see what some of the members are doing as they follow my course.

  3. Joanna says:

    Hi Andy

    I’m really struggling with inserting the code into the home.php & single.php templates. They both look a mass of code and it’s hard to track down the exact place I should be inserting the code into. It’s the same for the . I am using WordPress 2.8.6.

    The other option would be to say ‘yes’ to MATCH CURRENT POSTS AUTHOR and then under PLACEMENTS say ‘yes’ to OUTPUT AFTER POST. But this still leaves me with the problem of where to insert the and how to guarantee that the similar posts will be listed under the .

    I’m doing your Wordpress for Affliates Course, but unfortunately it doesn’t cover configuring plugins.

    Thanks very much

    • Andy says:

      Joanna
      If you are having problems with the course, please PM me on the course support forum.

      • Joanna says:

        Hi Andy

        I’m not really having problems with the course itself. I’m just stuck at the configuring of the plugins part as the place I’ve reached in the WFA course doesn’t go into that. I’ve managed to source some of the info on the net, it’s just that I’m stuck on the Similar Posts plugin. I’ve read your tutorial above, but still have uncertainties & I’d be grateful if you could guide me with an answer.

        Perhaps if you update the WPA course you could cover configuring of plugins in detail as some of the instructions that come with the plugins are a bit techie. Searching the internet, there doesn’t seem much on plugin tutorials for beginners and I’ve found it very frustrating and time consuming making sense of the information I did manage to find. I’m sure there must be others like me as WordPress become more popular as a publishing platform. Maybe this could be your next course!?

        Many thanks

        • Andy says:

          Joanna
          Just PM me on the course forum with details of your problem.

          • Joanna says:

            It’s Ok – I don’t really want to explain myself twice – a reply here would have been appropriate as my question just relates to this plugin tutorial and not the actual WFA course. Never mind, I’ll try getting an answer elsewhere.

  4. Andy says:

    Joanna
    I am not trying to be difficult here, its just that what you want to do is not as simple as me saying put the code on line 10. I need to see your templates, and that kind of discussion is better done outside of a comment system on a blog.

Trackbacks

Check out what others are saying about this post...
  1. [...] that allows me to include a list of related posts at the end of my articles.  I created this Similar Posts Tutorial for those who want to see how to use [...]



Leave A Comment...