How to Create or Display Custom Related Post in WordPress

Displaying related post to your blog post is quite important and it also helps traffic as visitor can stay longer in your site or it is commonly called inbound link it really help add organic traffic in your site, to implement related post in WordPress is easy, there are many ways to do it, by plugin, custom code or other way around; in this tutorial I’ll show you how to create related post by using WordPress Query.


This code display all related posts based on the current post tag(s), this must be pasted inside the loop, copy and paste the snippet below.


  • tag_slug__and: List of related slug to display.
  • ignore_sticky_posts: Ignore sticky posts. Default value is false.
  • post_count: Number of posts to display.
  • post__not_in: Not to include list of posts, in this case the current post being dispaled.

For more information you can visit at WordPress Codex

That’s it, hope it helps.

by Ryan Sutana