Displaying related posts on your WordPress site is an effective strategy to engage readers, lower bounce rates, and increase page views.
By highlighting content that aligns with what users are currently reading, you can motivate them to explore more of your site, ultimately enhancing user satisfaction and retention.
At CanadaCreate, we implement this strategy to improve the reader experience, and now we’ll guide you on how to display related posts in WordPress as well.
We will explore various methods, including plugins and custom code, providing you with flexible options to add related posts to your site.
The Importance of Showing Related Posts in WordPress
When launching a new WordPress website, your readers can easily find all your content. However, as your site expands, so does the number of articles, making it challenging for visitors to locate your most significant posts.
A straightforward method to help visitors discover new content on your site is by displaying related posts. This allows you to showcase your best content, keeping readers engaged and reducing your bounce rate.
As your readers interact with more of your content, you are more likely to foster trust, which can aid in growing your email list or boosting your sales.
In this article, we will explore three effective methods for displaying related posts, allowing you to choose the option that best suits your needs.
- Display Popular Posts in WordPress with MonsterInsights (Recommended)
- Display Related Posts Using the YARPP Plugin
- Manually Add Related Posts in WordPress
Show Popular Posts in WordPress with MonsterInsights
We believe that showcasing the most popular posts instead of related ones can increase clicks and boost user engagement. This is why many leading publishers now prioritize popular or trending posts over related posts.
The simplest way to display popular posts in WordPress is by utilizing MonsterInsights, the top analytics plugin for WordPress. MonsterInsights simplifies the process of using Google Analytics and provides valuable reports directly in your WordPress dashboard.
MonsterInsights allows you to set up Google Analytics in WordPress without the need for coding or hiring a developer. It includes advanced tracking features such as ad tracking, eCommerce tracking, link click tracking, and more.
With MonsterInsights, you can showcase your top blog posts anywhere on your website using the Popular Posts feature. You can start with the free version of MonsterInsights.
To access the popular posts add-on, advanced tracking features, dashboard reports, and additional customization options for your related posts, consider upgrading to the MonsterInsights Pro version.
Begin by installing and activating the MonsterInsights plugin. For detailed instructions, refer to our guide on how to install a WordPress plugin.
Once activated, you will be taken to Insights in your WordPress admin panel. Click the ‘Launch the Wizard’ button to set up the plugin on your site.
Next, navigate to Insights » Popular Posts in your WordPress dashboard. MonsterInsights provides various options for displaying related posts on your website.
You can choose the ‘Inline Popular Posts’ option to feature articles within your content or use the ‘Popular Posts Widget’ to showcase related posts at the end of a blog post or in the sidebar. Additionally, there’s an option to highlight popular products for your online store.
For this tutorial, we will utilize the Popular Posts Widget option to display related posts at the conclusion of an article.
MonsterInsights includes pre-designed templates for displaying related posts. Upgrading to the Pro version allows you to access more themes and design options for showcasing your popular posts.
The ‘Theme Preview’ section provides a visual representation of how your related posts will appear on your website.
After choosing a theme, scroll down to customize its design to fit your style.
You can modify the title and background colors and sizes, adjust the layout, and select the number of posts to display in the widget.
Next, navigate to the ‘Behavior’ section to customize the Widget Styling. You can either use the default styling or implement custom CSS to enhance the look of your popular posts widget.
After styling the widget, decide how to select the related posts to display. MonsterInsights can organize popular posts based on comments, share counts, or a custom list of posts you provide.
The Comments option will randomly rotate the most commented posts from the last 30 days. Alternatively, you can link your SharedCount account to display posts with the highest share counts.
You can also use the Curated option to specify which posts to display in the widget. Just add the desired posts and pages to the list, and the plugin will randomly showcase them.
If you have the MonsterInsights Pro version, you can automatically display the top 5 posts from the last 30 days based on your website’s traffic.
You can choose to display a title for the widget by toggling the ‘Display Title’ option. Click the toggle to activate it and enter a title that will be shown above your related posts.
Next, select ‘Posts’ as the post type to include in the widget. You also have the option to exclude certain posts from the related posts widget and to display posts from specific categories.
Now, decide how you want to embed your popular posts widget in WordPress. MonsterInsights provides various options, allowing you to choose between manual or automatic placement.
If you opt for ‘Automatic Placement,’ the plugin will automatically display your related posts after the last paragraph of your blog posts.
Alternatively, you can manually display the related posts widget on any post or page using a shortcode or the Popular Posts block.
To do this, edit an existing post or create a new one. In the WordPress editor, click the ‘+’ icon and add a ‘Popular Posts’ block where you want it to appear in your content.
The plugin will automatically showcase your most popular articles as related posts.
You can now visit your website to see the related posts in action.
Display Related Posts Using the YARPP Plugin
One effective method to showcase related posts in WordPress is by utilizing the Yet Another Related Post Plugin (YARPP). This plugin is highly regarded for its ability to automatically display your most popular blog posts.
YARPP employs a customizable algorithm that evaluates post titles, content, tags, and categories to assign a score to each pair of posts on your blog.
However, a potential drawback of YARPP is that it may slow down your website, particularly if you have extensive content. It’s advisable to conduct a website speed test before and after installation, and adhere to WordPress performance best practices to maintain fast loading times.
To get started, you need to install and activate the YARPP plugin on your website. For detailed instructions, refer to our guide on installing a WordPress plugin.
Once the plugin is activated, navigate to Settings » YARPP in your WordPress dashboard to configure the plugin settings.
In the ‘The Pool’ section, you can select which post types to include in related posts, such as posts, pages, media, and products.
Additionally, there are options to exclude content from specific categories and tags, set the time frame for determining related posts, and more.
Afterward, simply scroll down to adjust the algorithm settings.
Adjust the ‘Match threshold’ to control how closely related posts are selected. Increasing the Match threshold will make the algorithm more selective.
The default Match threshold is set to 1, which allows for a broader selection of related posts. It’s advisable to start with the default settings and fine-tune them as your website develops.
Consider additional settings for matching titles, content, categories, tags, and more to enhance the accuracy of related post suggestions.
Scroll down to the ‘Automatic Display Options’ section to choose how you want your related posts to be displayed. The plugin provides three formats: List, Thumbnails, or a custom theme.
You can specify the maximum number of posts to show in the related posts section and select the location for automatic display of related content.
After adjusting your display settings, scroll down to preview how your related posts will look on your site.
Finally, scroll down to enable the RSS Feeds and REST API options.
Once you’ve made your adjustments, click the ‘Save Changes’ button to apply them.
Now, visit your website to see the related posts feature in action.
Manually Add Related Posts in WordPress
Although we advise against manually adding related posts, it is possible. Some plugins may slow down your website by adding unnecessary bloat.
By adding custom code in WordPress, you gain full control over how the related posts section looks and functions.
To begin, install the WPCode plugin, which is the top code snippets plugin used by over 2 million WordPress sites. It simplifies the process of adding code snippets without needing to modify your theme’s functions.php file.
We recommend using WPCode because even minor mistakes while editing your WordPress theme can potentially break your site.
First, install and activate the WPCode plugin. For detailed instructions, refer to our tutorial on installing a WordPress plugin.
After activation, navigate to Code Snippets » + Add Snippet. Then, hover over ‘Add Your Custom Code’ and click ‘Use Snippet.’
Now, proceed to add the following code snippet below:
<div class="related-posts-after-content">
<h3>You May Also Enjoy</h3>
<?php
$orig_post = $post;
global $post;
$tags = wp_get_post_tags( $post->ID );
if ( $tags ) {
$tag_ids = array();
foreach ( $tags as $individual_tag ) {
$tag_ids[] = $individual_tag->term_id;
}
$args = array(
'tag__in' => $tag_ids,
'post__not_in' => array( $post->ID ),
'posts_per_page' => 4, // Number of related posts to display.
'caller_get_posts' => 1,
);
$my_query = new WP_Query( $args );
while ( $my_query->have_posts() ) {
$my_query->the_post();
?>
<div class="related-thumb">
<a rel="external" href="<?php the_permalink(); ?>">
<?php the_post_thumbnail( array( 150, 100 ) ); ?><br>
<?php the_title(); ?>
</a>
</div>
<?php
}
}
$post = $orig_post;
wp_reset_query();
?>
</div>
Insert it into the code area, and select ‘PHP Snippet’ next to Code Type.
You can assign a name to the custom snippet for easy editing or deactivation later.
Next, scroll down the page and select ‘Insert After Content’ next to ‘Location.’
This will place the related post snippet at the end of your post content.
Then, scroll back up to the top right corner of the page.
Switch the button to ‘Active’ and click ‘Save Snippet.’
You have successfully added the code to display related posts at the end of your content.
Now, check your blog posts to ensure the related posts feature is functioning correctly.
Alternative Option:WPCode provides a pre-made code snippet for showcasing related posts by category in a straightforward list.
Simply navigate to Code Snippets » Library and search for the snippet titled ‘Display Related Posts by Category’. Once located, hover over it and click the ‘Use snippet’ button.
WPCode will automatically insert the code for you and select the appropriate insertion method.
Next, just toggle the switch from ‘Inactive’ to ‘Active’ and click the ‘Update’ button.
That’s all! You can visit your blog to see related articles displayed at the end of your posts.
Additionally, you can explore our tutorials on displaying related posts with thumbnails in WordPress and showing recent posts in WordPress.
We hope this article has helped you learn how to display related posts in WordPress. You may also want to check our guide on adjusting the number of posts displayed on your WordPress blog page and our list of reasons why your website visitors might not be converting into customers.
If you enjoyed this article, consider subscribing to our YouTube Channel for insightful WordPress video tutorials. You can also connect with us on Twitter and Facebook.



