Skip to content
Home » How To Add Related Posts in WordPress Without plugin

How To Add Related Posts in WordPress Without plugin

Add Related Posts in WordPress

If you’re looking to add related posts in WordPress, then you’re at the right place. In this post, we’ve shared how you can add related posts in WordPress without plugins and Best Related Post WordPress plugins to show similar articles.

Primarily there are 2 methods to add Related Posts in WordPress websites:

1. Add Related Posts in WordPress without a plugin.

2. Add Related Post in WordPress with Plugin.

What Related Post Plugin Does?

Related Post WordPress plugins help website owners to increase user engagement on their website by displaying related posts to their visitors. These type of plugins works by analyzing the content of the current post and suggesting other posts that are related to the topic.

Related Post plugins can be easily installed on a WordPress website and customized to match the look and feel of the website. It uses algorithms to analyze the content and suggest related posts based on the title, tags, categories, and content of the current post.

The plugin also allows website owners to specify which posts should be excluded from the related post display and to limit the number of related posts displayed.

How Related Posts is Increases Blog Traffic?

Related Post plugins can increase blog traffic by encouraging visitors to stay on a website for a longer period and explore more content. By displaying a list of related posts at the end of each article or blog post, the plugin provides visitors with a convenient way to find more information on a topic they are interested in.

Here are some ways that the Related Post plugin can help increase blog traffic:

  1. Increases Pageviews: Displaying related posts, the plugin encourages visitors to direct to other pages on the website, increasing the number of page views per visitor and total pageviews.
  2. Reduces Bounce Rates: The related post list can help to reduce the bounce rate on a website by encouraging visitors to stay on the site longer and explore more content.
  3. Improves User Experience: The plugin can enhance the user experience on the website by giving users additional content on a subject they are interested in, which may encourage them to return more frequently and interact more actively.
  4. Promotes Older Posts: The Related Post plugin can help to promote older posts on a website that may not be getting as much traffic, by suggesting them as related content to visitors.
  5. Increases Social Sharing: Visitors who find the related posts interesting and informative are more likely to share them on social media, which can help to increase the website’s reach and bring in more traffic.

How to Add Related Posts in WordPress without Plugin

Adding related posts in WordPress is not difficult if you’re using a plugin, but you may need some help to add this function without the plugin.

In this short tutorial, we’re going to share how you can add related posts in WordPress by adding some lines of code in your single.php file and style.css file within minutes.

You can use both tags and categories to show related posts, but in this tutorial, we’re using categories.

Step-1: Open Single.php theme code editor for which you have to log in to WordPress Admin Dashboard > Appearance > Theme File Editor.

Step -2: Copy the below code and paste it at the end of the single.php file just before the closing tag which may look like the below image.

<?php

$catArgs = array(

‘category__in’ => wp_get_post_categories($post->ID),

‘showposts’ => 3,//display number of posts

‘orderby’ =>’rand’,//display random posts

‘post__not_in’ => array($post->ID)

);

$cat_post_query = new WP_Query($catArgs);

if( $cat_post_query->have_posts() ) {

echo ‘<div id=”related_posts” class=”clear” ><h3>You May Also Like</h3><ul>’;

while ($cat_post_query->have_posts()) : $cat_post_query->the_post(); ?>

<div class=”related_itemspl”>

<div class=”related_thumb”>

<a href=”<?php the_permalink(); ?>” title=”<?php the_title(); ?>”> <?php the_post_thumbnail( ‘small-thumbnail’); ?> <?php the_title(); ?></a>

</div>

</div>

<?php endwhile;

echo ‘</ul></div>’;

wp_reset_query(); } ?>

Add Related Posts in WordPress

Step -3: Open style.css theme code editor for which you have to log in to WordPress Admin Dashboard > Appearance > Theme File Editor.

Step -4: Copy the below code and paste it at the end of the style.css file. Now save it and open your article to see related posts at the bottom of the page.

#related_posts ul {

width: 100%;

margin-top: 1.4em;

margin-bottom: 1.8em;

overflow: hidden

}

.related_itemspl:first-child {

margin-left: 0

}

.related_itemspl {

height: auto;

background: #e9e9e9;

width: 32.3%;

overflow: hidden;

margin-left: 1.5%;

padding: 1%;

float: left

}

#related_posts img,

.related_thumb {

width: 100%;

clear: both;

overflow: hidden

}

.related_thumb {

height: auto;

text-align: center

}

.postdbreadcrumb,

.postview {

text-align: left;

height: auto;

overflow: hidden

}

.related_thumb a {

clear: both;

line-height: 22px;

text-decoration: none;

color: #000;

display: block

}

#related_posts img {

border-radius: 4px;

height: 120px;

margin-left: auto;

margin-right: auto

}

.clear {

height: auto;

font-weight: 400

}

.clear ul {

margin: 0;

padding: 0

}

If you’ve any queries related to this code and style you can comment below, and we’ll surely help you.

Best Related Post WordPress Plugin

If you’re still not able to add related posts without a plugin and want to give it a try to WordPress plugin, then you can also choose any plugin from this list of 4 Best Related Post WordPress plugins.

1. YARPP – Yet Another Related Posts Plugin

YARPP is our personal favorite plugin which we use on all our websites to show related posts at the bottom of a blog post.

Features:

  • YARPP Plugin allows you to display related posts based on content, tags, categories, and custom taxonomies.
  • You can choose to display related posts based on relevance or date.
  • It offers several layout options and customizations, such as thumbnails and post excerpts.
  • The plugin has a templating system that allows you to create your own custom templates for the related posts display that matches the site theme.

Pros:

  • YARPP is simple to install and use.
  • The plugin’s developers continuously maintain and update it, and it has a huge user base.
  • YARPP is highly customizable and offers several layout options.
  • The majority of WordPress themes and other plugins are compatible with this plugin.

Cons:

  • YARPP plugin can be resource-intensive and slow down your website if not configured properly.
  • The plugin may not always accurately display related posts, especially if you have a large number of posts or custom taxonomies.
  • It does not have a built-in caching system, which can result in slow-loading related posts.

Overall, YARPP is an extremely popular and useful plugin for WordPress websites that shows related posts. Just like any plugin, it has advantages and disadvantages, so it’s crucial to weigh them before deciding whether to use it or not.

Add Related Posts in WordPress

Image Source: YARPP

2. Related Posts Thumbnails

The Related Posts Thumbnails plugin for WordPress is designed to display related posts on your website with thumbnail images. This plugin is available for free download and installation from the WordPress plugin repository.

Features:

  • You can use the plugin to show similar content together with thumbnail images, which can improve user interaction and lower bounce rates.
  • It offers a variety of display choices, such as grid and list layouts, as well as the ability to alter the size of the thumbnail photos and the number of linked articles that are shown.
  • The plugin also includes options for filtering related posts by category, tag, or custom taxonomy, allowing you to display only the most relevant posts to your visitors.
  • It is compatible with a variety of WordPress themes and can be customized using CSS styles.

Pros:

  • The plugin is easy to install and use, even for those with limited technical knowledge.
  • It provides a visually appealing way to display related posts, which can improve user engagement and reduce bounce rates.
  • The plugin is highly customizable, with several display options and filtering options available to tailor the related posts to your specific needs.
  • It is regularly updated and maintained, with new features and bug fixes being released on a regular basis.

Cons:

  • The plugin may not be compatible with all WordPress themes, and some customization may be required to get it to display correctly.
  • While the plugin is free to download and use, some of the more advanced features may require a paid upgrade to access.
  • The plugin relies on thumbnail images, which may not always be available or appropriate for all types of posts.

The Related Posts Thumbnails plugin is a useful tool for WordPress website owners who want to improve engagement and reduce bounce rates by displaying related posts with thumbnail images. Its customization options, ease of use, and compatibility with a variety of themes make it a valuable addition to any website.

Add Related Posts in WordPress

3. Contextual Related Posts

The Contextual Related Posts plugin is a WordPress plugin that adds a widget to your website or blog, displaying a list of related posts that are relevant to the content of the current post. This plugin is designed to help website owners and bloggers to keep their visitors engaged and interested in their content, by providing them with more content that is similar to what they are already reading.

Features:

  • Displays a list of related posts that are relevant to the content of the current post
  • Allows you to choose how related posts are displayed (number of posts, title length, excerpt length, thumbnail display)
  • Allows you to choose which posts are included in the related posts list (based on category, tag, or custom post type)
  • Highly customizable
  • Easy to install and use

Pros:

  • Easy to use, even for beginners
  • Highly customizable
  • Well-maintained and regularly updated
  • Helps to keep visitors engaged and interested in your content
  • Increases pageviews and reduces bounce rates

Cons:

  • Can slow down your website, especially if you have a large number of posts
  • May not always display the most relevant posts
  • Requires some configuration and setup time
  • May not work with some themes or plugins

Add Related Posts in WordPress

4. Inline Related Posts

The Inline Related Posts plugin is a tool for WordPress websites that allows users to display related posts within the body of their content. This plugin works by automatically generating a list of related articles based on the content of the post and displaying them in line with the rest of the article.

Features:

  • Customizable styling options
  • Responsive design
  • Ability to control the number of related posts displayed
  • Option to exclude certain posts or categories from being displayed
  • Automatic generation of related posts based on post content
  • Easy installation and setup

Pros:

  • Increases engagement on a website by encouraging visitors to read more content
  • Can help to increase pageviews and reduce bounce rates
  • Provides a convenient and user-friendly way to display related posts within the content of a post
  • Offers customizable styling options to match the look and feel of a website
  • Helps to keep visitors on a site for longer

Cons:

  • May not be suitable for all types of websites or content
  • The generated related posts may not always be relevant or helpful
  • The inline display of related posts may be distracting or intrusive for some users
  • Some users may prefer a different method of displaying related posts

May require additional configuration or optimization for optimal performance.

Add Related Posts in WordPress

Plugin
Ease of Use
Compatibility
Price
YARPP
Easy
Compatible
Free
Related Posts Thumbnails
Easy
Compatible
Free
Contextual Related Posts
Complex
Compatible
Free

This table highlights the main differences between the plugins, but keep in mind that each plugin offers its own unique set of features and customization options. The best choice for you will depend on your specific needs and preferences.

How To Use YARPP WordPress Plugin to Add Related Posts in WordPress

WordPress offers a wide range of plugins that can simplify the process of adding related posts some of which you’ve already read about in the above section. Among these, Yet Another Related Posts Plugin (YARPP) stands out as one of the most recommended options.

YARPP is a free and easy-to-use plugin that automatically suggests related content to your readers based on the content they are currently viewing. It uses a sophisticated algorithm to analyze the content of your posts and recommend other articles that are related to the current topic.

Steps to use YARPP: –

  1. Step: Install and activate WordPress Plugin directly from your website’s WordPress Dashboard.
  2. Step: Go to Settings > YARPP > “The Pool” and select all three options in “Post types to include”.
  3. Step: Edit “The Algorithm” section, if you’re a beginner then you can leave it on the default setting.
  4. Step: Configure “Automatic Display Options” as per your requirement and website structure. We recommend you to select the “thumbnails” theme and the maximum number of posts change to 4.

Add Related Posts in WordPress

Conclusion

After analyzing various related post plugins, we highly recommend the Yet Another Related Posts Plugin (YARPP) as the most favorite. YARPP is a powerful and flexible plugin that provides accurate and relevant related post recommendations to your users. It is easy to install and use, and offers customization options to match your website’s design and layout.

Moreover, YARPP’s algorithm is highly advanced and effective, ensuring that your users see the most relevant content based on the content they are currently viewing. This not only improves user engagement but also increases the chances of your users staying on your website for longer and visiting other pages.

Overall, if you want a reliable and effective related post plugin for your WordPress website, we highly recommend YARPP. It is a great investment for any website owner who wants to improve their user engagement and increase their page views.

Leave a Reply

Your email address will not be published.

CommentLuv badge