[00] Subset Search, User guide
Related posts with Pro
Show posts on the same subject under each post with Subset Search Pro's Related posts block, pick some by hand and tune how they're found.
Subset Search Pro lists related posts under a post: posts on the same subject, found in the index Subset Search already keeps. This page shows you how to add the list, choose posts by hand and change how they’re found. Related posts need Subset Search Pro 1.7.0 and Subset Search 1.12.0 or later.
Add the block
- Open your single post template in Appearance → Editor, or open a post in the block editor.
- Add the Related posts block where the list should go, usually after the post content.
- In the block’s sidebar, choose List or Grid, and whether each post shows its featured image, excerpt and date. Number of posts overrides the number on the Related tab for this block.
In a template, each post shows its own related posts. The list takes your theme’s link and text styles. When a post has nothing related, the block prints nothing.
On a classic theme, put the [subset_related] shortcode in a post or a widget, or ask your developer to call subset_search_related() in the template. The developer reference lists the shortcode’s options.
How related posts are found
Subset Search takes the words a post uses often that few other posts use, 12 by default, and searches for them without the post itself. Posts that share more of those words rank higher, with the same field weights and Pro boost rules as your searches.
With semantic search on, posts close in meaning count too. They come from the vectors semantic search already stored, so finding them makes no OpenRouter requests. The two lists are merged, and a post that shares both words and meaning comes first.
Only published posts that aren’t password-protected appear. By default they’re the same post type as the post they’re on, and with Polylang or WPML, in the same language.
Choose posts by hand
In the block editor, open the Post sidebar and then Related posts:
- Show these first: search for a post and pick it. Up to 5 posts come first, in the order you add them, before the ones found for you. They can be any post type.
- Hide related posts on this post shows no list on this post.
- Don’t show this post as related keeps it out of every other post’s list.
A post set to Exclude from search in the Search panel is left out of related posts too.
Change how they’re found
Open Subset → Search → Related:
| Setting | Default | What it does |
|---|---|---|
| Post types | The post’s own type | The types related posts come from. Leave every box unticked to use the post’s own type. |
| Number of posts | 5 | How many posts show, up to 20. A block or shortcode can show a different number. |
| Words compared | 12 | How many of a post’s most telling words are searched for. More words find more posts, less closely related. |
| Meaning | On | Also finds posts close in meaning while semantic search is on. |
| Language | On | With Polylang or WPML, shows only posts in the post’s language. |
| Minimum score | 0 | Leaves out posts that match a post’s words less well than this, so a post with few words, such as a gallery, shows nothing rather than weak matches. Posts found by meaning only aren’t affected. |
To choose a minimum score, run wp subset search related 123 with a few of your post IDs. It lists each related post’s score and whether it was found by its words, its meaning, both, or picked by hand.
Each setting can be pinned in wp-config.php, such as define( 'SUBSET_SEARCH_RELATED_COUNT', 4 );.
When the list changes
Each post’s related posts are found once and kept for 12 hours, so showing them costs one database read. They’re found again sooner after:
- any change to the search index, such as saving a post;
- a change on the Related tab or to Subset Search’s settings;
- a change to any post’s Related posts panel, or to its Exclude from search setting;
- new vectors from semantic search.
After a full rebuild of the index, wp subset search related warm finds them for every published post before your visitors ask.