SearchWP Blog

WordPress Tutorials, Tips, and Resources to Help Grow Your Business

How To Show Related Content In WordPress - Thumbnail

A reader finishes one of your blog posts, enjoys it, and then leaves because nothing else on the page catches their eye. When you show related content in WordPress, that same reader sees the next post, page, or product they’d want to open.

Guiding visitors to related content keeps them on your site longer. It also helps you upsell your products or services without much extra effort.

SearchWP’s Related extension picks those suggestions with your own search engine, so they stay on topic. You can set it all up without writing any code.

In this article, we’ll show you how to display related content in WordPress, from building a dedicated search engine to placing the related block on your posts.

Key Takeaways:

  • Discover how related content can increase engagement and boost sales.
  • Learn how to show related content in WordPress without writing any code.
  • Determine which content to display as related content for a specific page or post.

Showing related content is a great way to keep your audience interested. When visitors find something they like, they’re more likely to explore other similar topics on your site.

This keeps them on your site longer and makes them more likely to come back in the future.

For example, if you have a cooking blog and someone visits to learn how to bake a cake, you could suggest related recipes like frosting techniques or other cake varieties. The reader will likely click on these suggestions, staying engaged with your content.

Or, if you run an online store, showing related products can encourage more purchases. For instance, someone looking at a phone might also be interested in accessories like cases or screen protectors.

Displaying these related items increases the chances of additional sales.

So, let’s see step by step how you can use this strategy to boost your sales.

The fastest and easiest way to show related content in WordPress is by using SearchWP, the best search plugin for WordPress. It even comes with extra features to improve your website, and one of them is showing related content.

SearchWP - Best WordPress Search Plugin

More than 50,000 website owners rely on SearchWP to improve their websites and increase sales.

Apart from displaying relevant content in WordPress, here’s what SearchWP lets you do:

  • Exclude Content From Search Results: Improve search quality by filtering out irrelevant content or categories, so users find exactly what they’re looking for more quickly.
  • Prioritize Content in Search Results: You can adjust which content appears first in search results. This lets you highlight specific pages or items, making it easy to draw attention to what matters most.
  • Support Keyword Stemming: SearchWP can match different forms of a search term, so a search for “run” also finds “running” and “runs.” You can turn this on or off to suit your site’s needs.
  • Analyze Search Trends: Track what visitors are searching for on your site, and see deeper insights with the Metrics extension (Pro and up). This data shows you which topics people want, so you know what to write next.

Now, let’s walk through how to display related content in WordPress step by step.

Step 1: Install & Activate SearchWP

First, choose the SearchWP package that best serves your needs, as each package provides different features. The Related extension we’ll use in this tutorial comes with the Pro plan and higher.

After making the purchase, download the plugin file from the Downloads tab on your Account page.

Download SearchWP plugin from account area

After downloading the zip file, remember to copy your license key from the same page. You’ll need it to activate your SearchWP plugin later.

Once the download is complete, install and activate SearchWP like any other WordPress plugin.

After activation, a welcome wizard will appear. Click Start Onboarding Wizard to follow the initial setup configuration.

The SearchWP welcome screen with the Start Onboarding Wizard button

Alternatively, if you prefer to set up everything manually, go to SearchWP » Settings and open the General tab.

From there, paste the copied license key into the License Key field and click Verify Key to activate SearchWP.

Once your license key is verified, your licensing details will appear, confirming your successful activation.

SearchWP license information after a successful activation

Step 2: Configure Search Engine

Once activated, SearchWP immediately begins indexing your website content. To check the progress, navigate to SearchWP » Algorithm.

The SearchWP Algorithm screen showing the Default engine

The default engine indexes Posts, Pages, and Media files, along with other post types your site uses. However, you can choose which sources to index.

To do that, click the Sources & Settings button.

The Sources & Settings button on the Default engine

Next, check all the sources you want to index from the Sources list, and click Done when you’re finished.

Selecting sources for the Default engine and clicking Done

The best thing about SearchWP is that it lets you create multiple search engines to use different search settings for various needs. A separate engine lets you decide what counts as related content without changing the results of your regular site search.

So, let’s create a search engine dedicated to showing related content. To do that, click Add New next to Engines.

Clicking Add New to create a new SearchWP engine

Now, choose which sources you want to use to show related content. Let’s make Posts and Pages appear as related content.

If you’re running an online store with WooCommerce or Easy Digital Downloads, you can show related products as well.

Select Posts and Pages, then name the engine “Related” so that it’s easily recognizable. Finally, click Done when you’re satisfied.

Creating a Related engine with Posts and Pages as sources

After that, click Save to apply the changes we’ve made so far.

Saving the new Related engine

SearchWP keeps your index up to date in the background as your content changes.

However, you can start the process manually by clicking the Rebuild Index button.

The Rebuild Index button on the SearchWP Algorithm screen

Although this isn’t common, you might see the following popup during this process, depending on your website’s current configuration. When SearchWP indexes an image or document file, it gathers and saves all indexable data in its database.

If you prefer replacing the existing index data with new data, check Remove stored Document Content, PDF Metadata, and image EXIF when rebuilding index. Otherwise, leave it as is and click Continue Index Rebuild.

The Continue Index Rebuild popup with the stored document content option

That’s it, you’re all set.

Next, we’ll need to install SearchWP’s Related extension, which shows related content in WordPress.

To do that, visit SearchWP » Settings » Related from your WordPress dashboard.

The Related tab under SearchWP Settings before the extension is active

From there, click the Activate Extension button to go to the Extensions page.

The Activate Extension button on the Related settings tab

Note: If you see “Related is a PRO Feature” instead of the Activate Extension button, your license is on the Standard plan or hasn’t been verified yet. You’ll need a verified Pro or higher license to use the Related extension.

Now, find the Related extension in the list and click the Install button. SearchWP installs and activates it in one step.

Installing the Related extension from the SearchWP Extensions page

SearchWP has many more extensions for specific tasks. You can browse and use the ones that you need.

It’s time to configure how your website will show related content. To do that, visit SearchWP » Settings » Related, then choose the Layout Theme that blends with your website design.

Choosing a Layout Theme for the Related block

Using the settings below it, you can give the Related block a custom name in the Block Title field. You can also choose whether to show Descriptions and set how many Results to display.

The same section lets you pick a Layout Style (columns or a list) and an Images size, if you’d like thumbnails next to each suggestion.

Setting the Block Title, Results, Images, and Descriptions options

Most importantly, you need to define which Engine you’ll use to show related content.

Since we already created a new engine called Related, let’s pick that from this dropdown.

Selecting the Related engine from the Engine dropdown

If there are posts that should never appear as suggestions, like a thank-you page or an old announcement, you can list their IDs under Exclude Entries.

Adding post IDs to the Exclude Entries setting

Finally, click Save to apply the changes.

Saving the Related settings

Since every piece of content is unique, the suggestions you show alongside it should be unique as well. Picking them by hand for every post would take forever, so SearchWP does the first pass for you.

The first time you save a post, SearchWP fills its related keywords with the post’s title. Posts that existed before you installed the extension use their title too, so every post gets related content right away.

To fine-tune it, open a post, page, or product in Edit mode and scroll to the bottom. You’ll see a new section titled SearchWP Related Content.

From here, you can customize which content you want to display as related content for this particular post, page, or product.

The SearchWP Related Content section at the bottom of the post editor

Next, enter the keywords SearchWP should use to find related content in the Keyword(s) to use when finding related content field.

Once you do, you’ll see matching content appear in the Results Sample list below, based on your engine settings.

Entering keywords and previewing the Results Sample

Note: If you clear the keyword field completely and save the post, SearchWP skips related content for that post. Add keywords back whenever you want suggestions to return.

The Results Sample shows a list for each of your engines, so look at the one labeled Related. That’s the engine your visitors will see suggestions from, since we picked it in Step 4.

If you want a particular piece of content to always show as related content for this item, click the Settings button.

The Settings button in the SearchWP Related Content section

Then, use the search box under Always include to find the content you’re looking for.

When you find it, click on it to select it, and that item will always be displayed first in the related content for this post.

Picking a post under Always include in the SearchWP Related Content section

You can show related content on your website’s front end automatically or manually. Let’s show you how to do both, so you can go with the one that fits your needs.

To automatically show related content in WordPress, visit SearchWP » Settings » Related, then scroll down to find Auto-append.

The Auto-append section on the Related settings tab

Now, choose the post types where you want the Related block to appear automatically.

You can also choose where the block goes: at the Bottom of the post or after a specific paragraph. Let’s select Bottom.

Choosing post types and the Bottom placement for Auto-append

Finally, click Save when you’re satisfied with your settings.

Saving the Auto-append settings

SearchWP provides a Gutenberg block to show related content, and you can use it like any other block. To start, open the page or post in Edit mode and click the Add Block button.

Next, search for “Related” and select the SearchWP Related block from the list.

Selecting the SearchWP Related block in the block inserter

You should now see the block appear.

In the editor, it only shows the SearchWP logo as a placeholder, and the related content appears once you visit the front end.

The SearchWP Related block placeholder in the editor

Just as in Step 5, you can use the SearchWP Related Content section at the bottom to decide which content should be shown as related content.

Setting related keywords for a post that uses the SearchWP Related block

That’s it. When you’re satisfied with your configuration, click Save or Publish, depending on your scenario.

Publishing the post with the SearchWP Related block

If you’d rather place the block somewhere else, click the Embed button at the top of the Related settings screen.

The Embed Manually popup gives you a Shortcode ([searchwp_related]), a Widget for your sidebar on themes that support widgets, and a PHP Code snippet for theme templates.

The Embed Manually popup with the Gutenberg Block, Shortcode, Widget, and PHP Code options

Now, when you visit your website’s front end, the related content block will appear in the designated space, under the Block Title you set in Step 4.

Related content showing on the front end of a WordPress post

SearchWP doesn’t log these related content lookups as searches, so your search statistics only reflect what real visitors type.

Frequently Asked Questions

1. How does SearchWP decide which content is related?

SearchWP runs a search with the post’s related keywords through the engine you picked, so the matches follow that engine’s sources and settings.

If those keywords match fewer posts than your Results setting, it searches again with looser matching to fill the empty slots.

2. Which SearchWP plan do I need to show related content?

The Related extension is included with the SearchWP Pro plan and higher.

On the Standard plan, the Related settings tab shows an upgrade prompt instead of the Activate Extension button.

3. Can I stop certain posts from appearing as related content?

You can list post IDs under Exclude Entries on the Related settings tab to keep them out of every related block.

If you want to hide content from your regular site search as well, see our guide on how to exclude a category from WordPress search.

4. Do I have to add keywords to every post?

By default, SearchWP uses the post’s title as its related keywords, including posts published before you installed the extension. That means every post gets related content without extra work.

You can change the keywords in the SearchWP Related Content section at any time to point a post at a different topic.

What’s Next…

You can easily show related content in WordPress using SearchWP. Whether you’re running a blog, an online store, or a news website, related content gives visitors a reason to keep reading and discover more of what you offer.

We hope this article helped you learn how to show related content in WordPress. You may also want to see our guides on how to track searches on your WordPress site and how to customize the WordPress search results page.

Ready to keep visitors on your site longer? Get SearchWP Pro today to add related content and more, backed by our 14-day money-back guarantee.

author avatar
Aazim Akhtar

Create a Better WordPress Search Experience Today

Never lose visitors to unhelpful search results again. SearchWP makes creating your own smart WordPress search fast and easy.

Get SearchWP Now
Multiple Search Engines Icon