Learn the difference between WordPress Cron Jobs and Server Cron Jobs with examples, pros and cons. Make sure your website tasks run smoothly.
How to Show Related Posts in WordPress (With and Without Plugins)

Table of Contents
- What Are Related Posts in WordPress?
- Why Show Related Posts on Your WordPress Site?
- Method 1: Show Related Posts Using a Plugin
- Method 2: Show Related Posts Without a Plugin (Manual Code)
- Method 3: Show Related Posts Using a Widget
- Best Plugins to Show Related Posts in WordPress
- Final Tips for Displaying Related Posts
- FAQs
What Are Related Posts in WordPress?
Related posts are blog articles that are similar to the one the visitor is currently reading. These are usually based on categories, tags, or keywords.
Why Show Related Posts on Your WordPress Site?
Showing related posts helps in:
- Keeping visitors on your site longer
- Reducing bounce rates
- Improving SEO
- Increasing page views

Method 1: Show Related Posts Using a Plugin
Step-by-Step:
- Go to Plugins > Add New in your WordPress dashboard.
- Search for “Yet Another Related Posts Plugin (YARPP)” or “Contextual Related Posts.”
- Click Install and then Activate.
- Configure plugin settings under Settings > YARPP or the plugin menu.
- Choose how you want to display related posts – below content, in sidebar, etc.
Bonus: Some themes also support related posts built-in. Check your theme settings first.
Method 2: Show Related Posts Without a Plugin (Manual Code)
Step-by-Step:
You can add the following code to your theme’s single.php
file or via a custom plugin:
<?php
$categories = wp_get_post_categories($post->ID);
$args = array(
'category__in' => $categories,
'post__not_in' => array($post->ID),
'posts_per_page' => 4,
);
$related = new WP_Query($args);
if($related->have_posts()) {
echo '<h3>Related Posts</h3><ul>';
while($related->have_posts()) {
$related->the_post();
echo '<li><a href="' . get_permalink() . '">' . get_the_title() . '</a></li>';
}
echo '</ul>';
wp_reset_postdata();
}
?>
This code will show 4 related posts from the same category.
Method 3: Show Related Posts Using a Widget
If you want to display related posts in your sidebar or footer area, you can use a widget. Most related posts plugins include a widget you can easily add to your layout.
Steps:
- Go to Appearance > Widgets or Appearance > Customize > Widgets.
- Look for a widget called:
- “Related Posts (YARPP)”
- “Contextual Related Posts”
- or similar (based on the plugin you installed).
- Drag and drop the widget into the desired widget area (Sidebar, Footer, etc.).
- Set options like:
- Number of posts
- Title (e.g., “You Might Also Like”)
- Display thumbnails or not
- Save your changes.
Note:
If you’re using a block-based theme (like with Full Site Editing), go to Appearance > Editor > Templates and insert a Related Posts Block in the sidebar or after content using a plugin that supports blocks.
Best Plugins to Show Related Posts in WordPress
Here are some great plugins to try:
- YARPP (Yet Another Related Posts Plugin)
- Contextual Related Posts
- Jetpack by WordPress.com (has built-in related posts feature)
- Related Posts Thumbnails Plugin
Final Tips for Displaying Related Posts
- Use thumbnails for better visual engagement
- Keep the layout clean and simple
- Don’t overdo it – 3 to 5 related posts is ideal
- Make sure related posts are truly relevant
FAQs
Can I show related posts by tags instead of categories?
Yes, many plugins and custom code options allow filtering by tags or custom taxonomy.
Do related posts slow down my site?
Some plugins can add load time. Use caching and lightweight plugins to reduce impact.
What if my theme already shows related posts?
You might not need a plugin. Just style it better using CSS if needed.
Is showing related posts good for SEO?
Yes! It helps with internal linking and keeps users engaged longer.
This Post Has 0 Comments