How to Add Related Posts to WordPress (Modern Method) – Displaying related posts on your blog is a great way to keep readers engaged and increase page views. When visitors see additional content related to the article they are reading, they are far more likely to continue browsing your site.
Years ago, many WordPress users relied on the Ultimate Tag Warrior (UTW) plugin to display keyword related posts. However, modern versions of WordPress now include built in tagging, and there are much easier ways to display related posts without using outdated plugins.
This guide explains both the original UTW method (for historical reference) and a modern way to display related posts using WordPress tags.
The Old Method: Ultimate Tag Warrior
In early versions of WordPress, the Ultimate Tag Warrior plugin was one of the most popular tagging systems available. It allowed bloggers to organize posts with keyword tags and automatically display related posts based on those tags.
However, starting with WordPress 2.3, tagging functionality was added directly into the WordPress core system. Because of this, Ultimate Tag Warrior is no longer maintained and is considered obsolete.
If you are running a modern WordPress site, you should use the built in tagging system instead.
Modern Method: Display Related Posts Using WordPress Tags
The easiest way to show related posts today is by querying posts that share the same tags as the current article. This can be done by adding a small snippet of PHP code to your theme.
Step 1: Open Your Theme Editor
- Log in to your WordPress admin panel.
- Navigate to Appearance > Theme File Editor.
- Open the single.php template file (the single post template).
Step 2: Add the Related Posts Code
Add the following code snippet just above the comments section, usually before:
<?php comments_template(); ?>
Insert this code:
<div class="related-posts">
<h3>Related Posts</h3>
<?php
$tags = wp_get_post_tags($post->ID);
if ($tags) {
$tag_ids = array();
foreach($tags as $tag) $tag_ids[] = $tag->term_id;$args = array(
'tag__in' => $tag_ids,
'post__not_in' => array($post->ID),
'posts_per_page' => 4,
'ignore_sticky_posts' => 1
);$related_query = new WP_Query($args);
if ($related_query->have_posts()) {
echo '<ul>';
while ($related_query->have_posts()) {
$related_query->the_post();
echo '<li><a href="'.get_permalink().'">'.get_the_title().'</a></li>';
}
echo '</ul>';
}wp_reset_postdata();
}
?>
</div>
This code automatically finds posts that share the same tags and displays them below the current article.
Optional: Style the Related Posts Section
You can customize the appearance by adding CSS to your style.css file:
.related-posts {
margin-top: 30px;
padding-top: 15px;
border-top: 1px solid #ddd;
}.related-posts ul {
list-style: none;
padding-left: 0;
}.related-posts li {
margin-bottom: 6px;
}
Alternative: Use a Related Posts Plugin
If you prefer a plugin solution instead of editing theme files, there are several modern options available:
- Yet Another Related Posts Plugin (YARPP)
- Contextual Related Posts
- Jetpack Related Posts
These plugins automatically generate related posts using tags, categories, and content similarity.
Final Thoughts
Displaying related posts helps improve internal linking, reduce bounce rate, and keep readers exploring your content. While the Ultimate Tag Warrior plugin played an important role in early WordPress history, modern WordPress installations can easily achieve the same functionality using built in tags and a simple related posts query.
Once implemented, your visitors will always have additional relevant content to explore.