How to display related posts in WordPress
Today, we will discuss how to display related posts in WordPress.
Reasons for showing related posts in WordPress
At first, it is very important to maintain a good connection between you and your user. The more the user engages in your post, the less will be the bounce rate.
Secondly, it’s great for SEO writing. The more SEO-friendly content, the more it will rank. It increases the views on your post.
Moreover, displaying a related post in WordPress creates internal connections between different blogpost. Besides, it makes the reader stay longer on your page. As it is located below the post, the reader will get the idea to visit the related posts.
However, displaying the related posts section is not in WordPress by default. Therefore we will tell you how to display related posts in WordPress.
We can do it with the following methods.
- First, by using theme options
- Second, by using plugins
- Third, using code
1. Display related posts by using the theme option.
Many themes have options for displaying related posts. So, you can look at your theme options first and then by using plugins or code. There are many advantages of using theme options to add a related posts section. You Don’t have to install anything new, and the design of this section will perfectly match the whole post’s theme. Also, It is the easiest way of showing a related post on a WordPress site. For this, go to theme name option >>blog section>>enable display post option.
After this, you can check the appearance of your blog post.
We will explain this with the Behold theme, where the option for showing related posts is named Enable Related Posts.
Have a look at our case.
However, some themes may not even have options that let you do this.
Let’s move to our second option.
2. Display related posts Using WordPress plugins.
After the theme option, you can display related posts by using plugins.
Contextual Related Posts
It is a popular plugin for displaying related posts on your website and your feed. The related posts section is displayed below the content by default. The list of related posts is created on the basis of the title and content of the current post, making it more suitable. This plugin also comes in a widget, shortcode, and a Gutenberg block.
Install the plugin>>Go to Settings >> Related Posts >>Analyze the options >>Select the option >>Save
Related Posts Thumbnails Plugin for WordPress.
This plugin also comes in a widget, shortcode, or Gutenberg block to be used almost anywhere on the website.
Install the plugin>>Go to Settings >> Related Posts >>Analyze the options >>Select the option >>Save
Related Post Plugin
This plugin links your posts to related content within your website automatically. You can get attention and produce wonderful internal links.
Yet Another Related Posts Plugin
This plugin displays a list of related posts on your site based on their unique algorithm. This plugin is different from others which only use Tags or Categories to relate posts. It uses additional factors to improve accuracy.
CP Related Posts Plugin
This plugin displays related posts on your blog based on several factors. Relationships between posts are developed on the basis of keywords in the content. It also offers some good display settings, allowing you to customize the output of the related post feeds.
Related Posts via Categories Plugin
This plugin displays related posts based only on the category of your post. Each post will show the list of posts within similar categories. It is a good method for deciding whether two posts are related or not.
3. Display related posts Using WordPress code.
Last but not least, this is our last method to display related posts in WordPress using code.
This method is for the users who know how to code.
However, before using the code, you should review it carefully because a coding mistake can waste everything.
You can add the code either in the functions.php file of your theme or inside a site-specific plugin.
Paste the code given below in single.php, where you want to display related posts.
<?php //for use in the loop, list 5 post titles related to first tag on current post $tags = wp_get_post_tags($post->ID); if ($tags) { echo 'Related Posts'; $first_tag = $tags[0]->term_id; $args=array( 'tag__in' => array($first_tag), 'post__not_in' => array($post->ID), 'posts_per_page'=>5, 'caller_get_posts'=>1 ); $my_query = new WP_Query($args); if( $my_query->have_posts() ) { while ($my_query->have_posts()) : $my_query->the_post(); ?> <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a> <?php endwhile; } wp_reset_query(); } ?>
To sum up, the above post explains how you can display related posts in WordPress. By using the above methods, you can engage your readers to lower your bounce rate and increase your SEO rank. You can choose the way that fits you.
We have also explained displaying related post by two specific plugins, MonsterInsights and Yet Another Related Post Plugin in details. Check here.