WordPress Logo – Athemeart WordPress Themes

10 Best WordPress Related Posts Plugins (Free & Premium) + Shortcode Code

A visitor reads one article, gets what they came for, and leaves. It happens on almost every blog, and it is the exact moment WordPress related posts plugins are built to fix. By placing a short list of relevant articles under (or inside) your content, you give readers an easy next click, and you give search engines more internal links to follow.

We compared the most popular related post WordPress plugins from the WordPress.org directory and the premium market, looking at how each one picks matches, how much control you get over the design, how it behaves on WooCommerce stores, and how heavy it is on your server. Below you will find 10 solid options, a quick comparison table, and something most roundups skip: a copy-paste related posts shortcode and function you can drop into your theme if you would rather not install another plugin.

WordPress related posts displayed below an articleAn article card with three related post cards underneath, connected by arrows showing the reader moving to the next page.Related postsBest WooCommerce pluginsWordPress shortcodes guideOn-page SEO for beginners
A related posts block turns the end of an article into the start of the next one.

Why use a WordPress related posts plugin

By default, WordPress shows your newest content first. That is fine for a news feed, but it buries older articles that still deserve traffic. A reader who just finished a guide on image optimization does not necessarily want to see your latest post about hosting. A related posts block fixes that mismatch in three ways:

  • It lowers the chance of a quick exit. A relevant suggestion right where the reader finishes is a natural next step.
  • It strengthens internal linking. Every related link is an internal link, which helps crawlers discover pages and understand how your topics connect. If you are still building that foundation, our beginner’s guide to WordPress on-page SEO covers the basics.
  • It surfaces evergreen content. Older posts get a steady stream of fresh internal links without you editing them by hand.

Google also recommends using crawlable links with descriptive anchor text, which is exactly what a good related posts module outputs (see Google’s guidance on crawlable links).

How WordPress related posts are chosen

Every plugin in this list uses one of a few matching methods. Knowing them makes it much easier to choose.

How a related posts plugin finds matchesFour steps: current post, match by taxonomy or content or manual choice, rank and filter, then display as list, grid or inline box.1. Current posttitle, content, terms2. Matchcategories and tagstext similarity / manual3. Rankscore, date, exclusionscache the result4. Displaylist, grid, inline box
The four stages behind almost every related posts plugin.
  • Taxonomy matching: posts that share categories, tags or custom taxonomies. Fast and predictable.
  • Content matching: the plugin compares words in titles and body text. Contextual Related Posts and YARPP work this way, which usually gives smarter results but costs more database work.
  • Manual selection: you pick the related posts yourself. Slow on a big site, perfect for a small one.
  • Relationship fields: you define explicit relations between content types, such as products and guides.

What to look for before you install one

  • Matching quality: does it use tags and categories only, or also title and content?
  • Design control: thumbnails, excerpts, grid or list, and whether you can restyle it with CSS. Our guide to adding custom CSS in WordPress helps if the plugin has no style panel.
  • Placement options: automatic after content, a Gutenberg block, a widget, or a shortcode.
  • Performance: some plugins run heavier queries. Look for caching, and test your page speed after installing.
  • Compatibility: custom post types, multisite, WooCommerce and multilingual setups.
  • Maintenance: recent updates and an active support forum.

Quick comparison table

Plugin Price model How it matches Best for
Contextual Related Posts Free Title and content Smart automatic results, shortcode and block
YARPP Free Title, content, tags, categories Advanced templates, multilingual and WooCommerce sites
Related Posts by Taxonomy Free Any taxonomy Lightweight, developer-friendly output
Related Posts Thumbnails Free Categories and tags Image and video thumbnails
Jetpack Related Posts Free module Cloud analysis One-switch setup, no server load
Related Posts for WordPress Freemium Automatic plus manual Quick setup with a wizard
Custom Related Posts Free Manual Small sites that want full control
Inline Related Posts Freemium Automatic Boxes inside the article body
JetEngine Premium Defined relations Elementor sites with custom post types
Related Posts Pro Premium Weighted relatedness Sliders and many ready-made templates

Prices and free-version limits change, so check each plugin page before you buy.

The 10 best related post WordPress plugins

1. Contextual Related Posts

Contextual Related Posts (CRP) is one of the most widely used free options, and the reason is simple: install it and it starts working. It builds its list from the title and content of each post, so the suggestions tend to be more relevant than a plain category match.

  • Output through an automatic placement, a block, a widget or the [crp] shortcode
  • Works with posts, pages, custom post types and attachments
  • Thumbnails and excerpts, with editable HTML tags and custom CSS
  • Exclude categories or specific posts, and a REST API for developers
Pros: free, flexible, extendable with filters and actions, strong reputation.
Cons: matching uses title and content only, so there is no behavior-based logic; few built-in layouts.

Best for: anyone who wants smart automatic results with a free plugin.

2. YARPP (Yet Another Related Posts Plugin)

YARPP has been around for years and remains a favorite for sites that want fine control. Its algorithm weighs titles, body text, tags, categories and custom taxonomies, and you can set a match threshold so weak matches never appear.

  • Custom templates for full control over markup
  • Support for custom post types, multisite, bbPress and WooCommerce
  • Block editor support, shortcode, widget and RSS feed output
Pros: powerful algorithm, flexible placement, free.
Cons: can use more server resources than lighter plugins, and the settings screen takes a little time to learn.

Best for: larger blogs and multilingual or WooCommerce sites that need precise matching.

3. Related Posts by Taxonomy

Related Posts by Taxonomy finds related content through any shared taxonomy, whether that is a category, a tag or a custom one. It supports thumbnails, links, excerpts or full posts, and it is known for its small footprint.

Pros: fast, limits by date and number of posts, includes or excludes terms.
Cons: mainly widget and shortcode driven, and heavier styling means editing your theme stylesheet.

Best for: developers and speed-focused sites.

4. Related Posts Thumbnails

Most related post modules look plain. Related Posts Thumbnails puts images first, with adjustable thumbnail sizes and even video thumbnails. You can relate posts by categories, tags or both, and show the block via a Gutenberg block, a widget or a shortcode.

Pros: visual output, simple settings, free.
Cons: style options are limited to the basics such as colors and font size.

Best for: image-led blogs and magazine layouts.

5. Jetpack Related Posts

If you already run Jetpack, the Related Posts module is the easiest route. You switch it on and it adds a list after your posts. The analysis happens in the cloud, so it adds little load to your own server.

Pros: one-toggle setup, no server strain, block available.
Cons: limited customization beyond the defaults, and it requires the Jetpack plugin and a connection.

Best for: beginners who already use Jetpack.

6. Related Posts for WordPress

Related Posts for WordPress aims for a fast start: an installation wizard sets up automatic linking, and you can adjust individual posts by hand afterwards. It handles shortcodes and widgets and supports multisite.

Pros: easy setup, mix of automatic and manual links, mobile friendly.
Cons: the free version is fairly limited; the premium plan unlocks the rest.

Best for: site owners who want a guided setup.

7. Custom Related Posts

Not every site needs an algorithm. Custom Related Posts lets you pick related content manually in the post editor and display it with a shortcode, widget or block. It works with both the Classic and block editors, and you can set the featured image size.

Pros: total editorial control, simple, responsive.
Cons: manual work does not scale on large archives, and the feature set is basic.

Best for: small and new sites with a curated content strategy.

8. Inline Related Posts

Inline Related Posts does something different: it places the suggestion inside the article, between paragraphs, where readers are actually looking. It offers 20+ style combinations and a live preview in its settings, which suits news and editorial sites.

Pros: high visibility, quick to configure, many styles.
Cons: the free version limits how many boxes you can place and keeps the design simple.

Best for: publishers who want links in the middle of the content.

9. JetEngine

JetEngine is a different kind of tool. Instead of guessing what is related, you define explicit relations between posts, custom post types, taxonomies and users, then show them with a Listing Grid or Dynamic Field widget. With its Query Builder you can fine-tune the order of what appears.

Pros: the most flexible relation setup, full design control, developer settings.
Cons: premium only, and too much setup for a simple blog.

Best for: Elementor sites with custom post types and structured content.

10. Related Posts Pro

Related Posts Pro is a premium plugin that leans into presentation. It offers grid and slider layouts with a large library of templates, and a weighting option lets you decide how strictly a post must match before it is shown.

Pros: lots of layouts and customization options without touching code.
Cons: a heavier plugin, so test your page speed after activating it.

Best for: design-focused sites that want slider or grid layouts.

Other related post plugins worth a look

  • WordPress Infinite Related Next Post Manager: a premium CodeCanyon plugin with infinite loading, slider and sidebar display styles.
  • Super Simple Related Posts: a speed-first plugin with very few options; developers can adjust output with filters.
  • AI Related Posts: uses the pages a visitor has viewed to tailor suggestions.
  • Shareaholic: a broader toolkit that combines sharing buttons with recommended content.
  • Related Posts by PickPlugins: a freemium option with manual selection and query support.

Plugins are a convenient choice, but too many of them slow a site down. Before adding another one, review our list of must-have WordPress plugins so you keep your stack lean.

Related products for WooCommerce

For stores, related content means related products for WooCommerce. WooCommerce already shows a “Related products” block on each product page, built from shared categories and tags, so you may not need a plugin at all. Here is how to decide:

  • Use the built-in block if category and tag matches are good enough. You can change how many products and columns appear with a filter (code below).
  • Use YARPP if you want one plugin to handle both blog posts and products.
  • Use manual upsells and cross-sells for hand-picked bundles, which usually convert better than automatic suggestions.
  • Use a product slider to present related items attractively. See our roundup of WooCommerce product slider plugins.

If you are still choosing add-ons for your shop, our guide to essential plugins for WooCommerce is a good companion to this list.

Build your own: related post query, shortcode and function

If you only need a simple list, a few lines of code can replace a plugin. This section gives you three things: a basic WordPress related post query, a reusable shortcode for related post in WordPress, and WooCommerce tweaks. Add the code to a child theme’s functions.php or to a snippet plugin. If you have not used one before, see our guide to code snippets for WordPress.

Tip: need a different query, such as by author, custom field or date? Our free WordPress Query Generator builds a ready-to-use WP_Query for you, and you can paste the result into the code below.

Simple related post code (single.php)

This is the smallest useful version. It lists three posts from the same categories as the current one. The arguments follow the official WP_Query reference.

<?php
$cats = wp_get_post_categories( get_the_ID() );

if ( $cats ) {
	$related = new WP_Query( array(
		'category__in'        => $cats,
		'post__not_in'        => array( get_the_ID() ),
		'posts_per_page'      => 3,
		'ignore_sticky_posts' => true,
		'no_found_rows'       => true,
	) );

	if ( $related->have_posts() ) {
		echo '<h3>Related posts</h3><ul>';
		while ( $related->have_posts() ) {
			$related->the_post();
			echo '<li><a href="' . esc_url( get_permalink() ) . '">' . esc_html( get_the_title() ) . '</a></li>';
		}
		echo '</ul>';
		wp_reset_postdata();
	}
}
?>

The no_found_rows argument skips pagination counting, which makes the query lighter. post__not_in keeps the current article out of its own list.

Related posts shortcode and function

The version below matches by categories, tags or both, supports thumbnails and excerpts, caches the output for 12 hours, and clears the cache whenever you save a post. It uses the standard Shortcode API. If shortcodes are new to you, start with our shortcode fundamentals series.

<?php
/**
 * Build a WP_Query of related posts.
 */
function atheme_related_query( $post_id, $limit = 4, $by = 'both' ) {
	$tax_query = array();

	if ( in_array( $by, array( 'category', 'both' ), true ) ) {
		$cats = wp_get_post_categories( $post_id );
		if ( $cats ) {
			$tax_query[] = array(
				'taxonomy' => 'category',
				'field'    => 'term_id',
				'terms'    => $cats,
			);
		}
	}

	if ( in_array( $by, array( 'tag', 'both' ), true ) ) {
		$tags = wp_get_post_tags( $post_id, array( 'fields' => 'ids' ) );
		if ( $tags ) {
			$tax_query[] = array(
				'taxonomy' => 'post_tag',
				'field'    => 'term_id',
				'terms'    => $tags,
			);
		}
	}

	if ( empty( $tax_query ) ) {
		return false;
	}

	if ( count( $tax_query ) > 1 ) {
		$tax_query['relation'] = 'OR';
	}

	return new WP_Query( array(
		'post_type'           => get_post_type( $post_id ),
		'post__not_in'        => array( $post_id ),
		'posts_per_page'      => $limit,
		'ignore_sticky_posts' => true,
		'no_found_rows'       => true,
		'tax_query'           => $tax_query,
	) );
}

/**
 * Shortcode: [athemeart_related limit="4" by="both" title="You may also like" thumb="yes" excerpt="no"]
 */
function atheme_related_posts_shortcode( $atts ) {
	if ( ! is_singular() ) {
		return '';
	}

	$atts = shortcode_atts( array(
		'limit'   => 4,
		'by'      => 'both',     // category, tag or both.
		'title'   => __( 'You may also like', 'athemeart' ),
		'thumb'   => 'yes',
		'excerpt' => 'no',
	), $atts, 'athemeart_related' );

	$post_id = get_the_ID();
	$limit   = max( 1, min( 12, absint( $atts['limit'] ) ) );
	$by      = in_array( $atts['by'], array( 'category', 'tag', 'both' ), true ) ? $atts['by'] : 'both';

	// Cache the finished HTML. The version number changes whenever a post is saved.
	$version = get_option( 'atheme_related_ver', 1 );
	$key     = 'atheme_rel_' . md5( $post_id . '|' . $limit . '|' . $by . '|' . $atts['title'] . '|' . $atts['thumb'] . '|' . $atts['excerpt'] . '|' . $version );
	$cached  = get_transient( $key );

	if ( false !== $cached ) {
		return $cached;
	}

	$query = atheme_related_query( $post_id, $limit, $by );

	if ( ! $query || ! $query->have_posts() ) {
		return '';
	}

	ob_start();
	echo '<aside class="atm-related" aria-label="' . esc_attr( $atts['title'] ) . '">';
	echo '<h3 class="atm-related__title">' . esc_html( $atts['title'] ) . '</h3>';
	echo '<ul class="atm-related__list">';

	while ( $query->have_posts() ) {
		$query->the_post();
		echo '<li class="atm-related__item"><a href="' . esc_url( get_permalink() ) . '">';

		if ( 'yes' === $atts['thumb'] && has_post_thumbnail() ) {
			echo get_the_post_thumbnail( null, 'medium', array( 'loading' => 'lazy', 'class' => 'atm-related__thumb' ) );
		}

		echo '<span class="atm-related__name">' . esc_html( get_the_title() ) . '</span></a>';

		if ( 'yes' === $atts['excerpt'] ) {
			echo '<p class="atm-related__excerpt">' . esc_html( wp_trim_words( get_the_excerpt(), 18 ) ) . '</p>';
		}

		echo '</li>';
	}

	echo '</ul></aside>';
	wp_reset_postdata();

	$html = ob_get_clean();
	set_transient( $key, $html, 12 * HOUR_IN_SECONDS );

	return $html;
}
add_shortcode( 'athemeart_related', 'atheme_related_posts_shortcode' );

/**
 * Template tag: <?php atheme_related_posts( array( 'limit' => 3 ) ); ?>
 */
function atheme_related_posts( $args = array() ) {
	echo atheme_related_posts_shortcode( $args ); // phpcs:ignore WordPress.Security.EscapeOutput
}

/**
 * Clear cached lists when content changes.
 */
function atheme_related_flush_cache() {
	update_option( 'atheme_related_ver', time(), false );
}
add_action( 'save_post', 'atheme_related_flush_cache' );
add_action( 'deleted_post', 'atheme_related_flush_cache' );

Use it in the editor like this:

Shortcode Result
[athemeart_related] Four related posts, matched by categories and tags, with thumbnails
[athemeart_related limit="3" by="tag"] Three posts that share at least one tag
[athemeart_related title="Keep reading" thumb="no" excerpt="yes"] A text-only list with short excerpts and a custom heading

Show related posts automatically after every post

If you do not want to paste the shortcode in each article, append it through a content filter:

<?php
function atheme_append_related( $content ) {
	if ( is_singular( 'post' ) && in_the_loop() && is_main_query() ) {
		$content .= do_shortcode( '[athemeart_related limit="4"]' );
	}
	return $content;
}
add_filter( 'the_content', 'atheme_append_related', 20 );

Do not combine this with a manual shortcode in the same post, or the list will appear twice.

Minimal CSS

.atm-related{margin:2.5em 0;padding-top:1.5em;border-top:1px solid #e5e7eb}
.atm-related__list{display:grid;grid-template-columns:repeat(auto-fill,minmax(200px,1fr));gap:18px;list-style:none;margin:0;padding:0}
.atm-related__item a{display:block;text-decoration:none;color:inherit}
.atm-related__thumb{width:100%;height:auto;border-radius:8px;display:block;margin-bottom:8px}
.atm-related__name{font-weight:600;line-height:1.35}

WooCommerce related products code

To change how many related products WooCommerce shows, filter its output arguments. For hooks like this, our WooCommerce hooks list with examples is a handy reference, and the WooCommerce shortcodes guide covers the display side.

<?php
// Show 4 related products in 4 columns.
add_filter( 'woocommerce_output_related_products_args', function ( $args ) {
	$args['posts_per_page'] = 4;
	$args['columns']        = 4;
	return $args;
} );

// Optional: build the list from the same product category only.
add_filter( 'woocommerce_related_products', function ( $related_ids, $product_id, $args ) {
	$term_ids = wc_get_product_term_ids( $product_id, 'product_cat' );

	if ( empty( $term_ids ) ) {
		return $related_ids;
	}

	$ids = get_posts( array(
		'post_type'      => 'product',
		'fields'         => 'ids',
		'posts_per_page' => ! empty( $args['limit'] ) ? absint( $args['limit'] ) : 4,
		'post__not_in'   => array( $product_id ),
		'tax_query'      => array(
			array(
				'taxonomy' => 'product_cat',
				'field'    => 'term_id',
				'terms'    => $term_ids,
			),
		),
	) );

	return $ids ? $ids : $related_ids;
}, 20, 3 );

The second filter replaces WooCommerce’s own selection, so test it on your store (stock status, visibility and caching) before you rely on it. If WooCommerce’s default logic already works for you, keep only the first snippet.

Which related posts option should you pick?

Decision guide for choosing a related posts solutionA short decision tree that points to a plugin or custom code depending on site size, store needs and design needs.What do you need?Quick and freesmall or medium blogOnline storeproducts, not postsCustom layoutssliders, relations, CPTsContextual RelatedPosts or YARPPor the shortcode aboveBuilt-in relatedproducts + upsellsor YARPP for mixed sitesJetEngine orRelated Posts Propremium control
Start from what you actually need, not from the longest feature list.
  • Brand-new blog with a handful of posts: Custom Related Posts, or the simple code above.
  • Growing content site: Contextual Related Posts or YARPP for automatic, relevant matches.
  • Visual or magazine layout: Related Posts Thumbnails, or Related Posts Pro for sliders.
  • News or editorial site: Inline Related Posts for mid-article links.
  • Structured content with custom post types: JetEngine.
  • You already use Jetpack: turn on its Related Posts module and move on.

Placement and performance tips

  1. Show three to six items. More links dilute attention and add database work.
  2. Use real thumbnails and clear titles. Descriptive anchor text beats vague labels, and it helps both readers and search engines.
  3. Place one block after the content. Add a second inline block only on long articles.
  4. Cache the output. Related queries repeat on every page view, so page caching or the transient approach in our code saves resources.
  5. Exclude thin pages. Keep thank-you pages, landing pages and outdated posts out of the results.
  6. Test on mobile. A block that looks tidy on desktop can stretch awkwardly on a phone. Check your theme’s sidebar behavior too; see our guide on WordPress sidebars.
  7. Measure the result. Compare pages per session and exit rate for a few weeks before and after, rather than guessing.

Frequently asked questions

What is the best related posts plugin for WordPress?

For most sites, Contextual Related Posts and YARPP are the strongest free choices because they match on content as well as taxonomy. Pick Custom Related Posts for manual control or JetEngine for advanced relations.

Do related posts help SEO?

They add internal links, which help search engines find and connect your pages, and they give readers more reasons to keep browsing. They are not a ranking guarantee, so treat them as one part of a wider internal linking plan.

Can I add related posts without a plugin?

Yes. Use a WP_Query in your theme, or the shortcode and function code in this article. It is a good option if you want fewer plugins and full control over the markup.

How do I add related products in WooCommerce?

WooCommerce shows related products automatically from shared categories and tags. You can adjust the number of products with the woocommerce_output_related_products_args filter, set upsells and cross-sells by hand, or use a plugin such as YARPP.

Will a related posts plugin slow down my site?

It can. Plugins that analyze full content run heavier queries than taxonomy-only ones. Choose a plugin with caching, keep the number of results low, and test your speed after activation.

What is the difference between related posts and recent posts?

Recent posts are sorted by date and are the same on every page. Related posts depend on the article being read, so they are far more likely to match the reader’s interest.

Can I show related posts in the middle of an article?

Yes. Inline Related Posts is built for that, and the shortcode above can be pasted between paragraphs in the editor.

Final thoughts

A good related posts plugin is one of the cheapest ways to keep readers on your site longer and to make better use of content you have already published. For most blogs, start with Contextual Related Posts or YARPP, add a clean thumbnail layout, and check your results after a few weeks. If you prefer to stay lightweight, the shortcode in this guide gives you the same core feature without another plugin. Whichever route you choose, keep the list short, relevant and fast.

Inspire us with your love!

Saiful Islam

By Saiful Islam

Saiful Islam, the founder of aThemeArt, is a successful freelancer, a father of two boys, and an enthusiast in coding, YouTube, and gaming. Connect with me on Twitter, Facebook, and Instagram to stay updated with my latest endeavors.

You can check also

Leave a Reply

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

*
*