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.
- 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.
- 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.
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:
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.
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:
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:
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.
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:
- 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:
- Top 12 Wordpress Plugins For Wordpress 2.7.x - Here is my top 12 Wordpress plugins for Wordpress 2.7.x Share and Enjoy:




















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?
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.