skip to Main Content

How to Show Related Posts in WordPress (With and Without Plugins)

How to Show Related Posts in WordPress

Table of Contents

  1. What Are Related Posts in WordPress?
  2. Why Show Related Posts on Your WordPress Site?
  3. Method 1: Show Related Posts Using a Plugin
  4. Method 2: Show Related Posts Without a Plugin (Manual Code)
  5. Method 3: Show Related Posts Using a Widget
  6. Best Plugins to Show Related Posts in WordPress
  7. Final Tips for Displaying Related Posts
  8. FAQs

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.


Showing related posts helps in:

  • Keeping visitors on your site longer
  • Reducing bounce rates
  • Improving SEO
  • Increasing page views

How to Show Related Posts in WordPress

Step-by-Step:

  1. Go to Plugins > Add New in your WordPress dashboard.
  2. Search for Yet Another Related Posts Plugin (YARPP) or “Contextual Related Posts.”
  3. Click Install and then Activate.
  4. Configure plugin settings under Settings > YARPP or the plugin menu.
  5. 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.


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.


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:

  1. Go to Appearance > Widgets or Appearance > Customize > Widgets.
  2. Look for a widget called:
    • Related Posts (YARPP)
    • Contextual Related Posts
    • or similar (based on the plugin you installed).
  3. Drag and drop the widget into the desired widget area (Sidebar, Footer, etc.).
  4. Set options like:
    • Number of posts
    • Title (e.g., “You Might Also Like”)
    • Display thumbnails or not
  5. 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.


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

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

I’m a WordPress developer with 10+ years of experience in WooCommerce and custom plugins. I combine technical expertise with design flair to help you create standout, user-friendly websites. Let’s transform your digital presence!

This Post Has 0 Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

Back To Top