Hey there, WordPress pro! π Are you ready to supercharge π your site‘s engagement and SEO? Today, we‘re diving deep into the world of related pages β a powerful strategy that can keep visitors glued to your content and send your search rankings soaring.
But why are related pages so important? Let‘s look at some eye-opening data:
- Related pages can increase pageviews by up to 58% (Source)
- Sites with related content links have a 30% lower bounce rate on average (Source)
- 69% of users say they are more likely to remain on a site with relevant page recommendations (Source)
Clearly, if you‘re not leveraging related pages, you‘re leaving huge potential on the table. But as a savvy WordPress user, you don‘t just want to slap some links together and call it a day. You want a strategic, purposeful approach that delivers maximum impact.
That‘s exactly what this guide is all about. We‘ll explore two powerful methods for displaying related pages on your WordPress site:
- π Using a dedicated related pages plugin
- π» Manually adding related pages using WordPress tags and custom code
Whether you‘re a coding ninja or prefer the simplicity of plugins, we‘ve got you covered.
Method 1: Displaying Related Pages with a Plugin
For most WordPress users, a plugin offers the quickest and easiest path to related page success. While there are several great options out there, our top pick is undoubtedly Yet Another Related Posts Plugin (YARPP).
What makes YARPP so awesome? Let‘s break it down:
| Feature | Benefit |
|---|---|
| Advanced algorithm | Finds the most relevant related pages based on titles, content, tags, and categories |
| Customizable display | Lets you control where related pages appear and how they look |
| Thumbnail support | Grabs attention with eye-catching featured images |
| Performance optimization | Efficiently caches results for faster page loads |
Sold? Here‘s how to get YARPP up and running on your site:
Step 1: Install and activate the plugin by navigating to Plugins β Add New in your WordPress dashboard. Search for "Yet Another Related Posts Plugin" and click Install Now followed by Activate.
Step 2: Head to Settings β YARPP to configure the plugin‘s behavior. Here are the key sections to pay attention to:
- The Pool: Choose whether to display related posts, pages, or both. Make sure "Pages" is checked β since that‘s our focus.
- Algorithm: Adjust the "match threshold" π― to fine-tune the relevance of displayed pages. A higher value means fewer but more closely related recommendations.
- Automatic Display: Specify where related pages should appear, how many to show, the layout style, and customize the look π¨ with predefined themes.
- Preview: Get a real-time glimpse π of how your related pages will appear across different devices.
Once you‘re happy with the settings, hit Save Changes.
Step 3: Bask in the glory of your newly added related pages! π YARPP will now automatically append relevant page recommendations to your content based on your configuration.
Take a look at this before and after from WPBeginner, showing how much value related pages can add:

Source: WPBeginner
The best part? YARPP takes care of all the heavy lifting for you, using its advanced algorithm to uncover the most valuable related page opportunities. It‘s like having a highly-paid content strategist on staff, but without the overhead! πΈ
Of course, no solution is one-size-fits-all. If you have a very specific vision for which pages to display or your host doesn‘t play nice with plugins, you may want to try the manual approachβ¦
Method 2: Adding Related Pages Manually With Tags and Code
For the DIY-inclined, WordPress‘s built-in tagging system π·οΈ is the key to unlocking precise control over your related pages. Pair those tags with a little custom code magic β¨, and you‘ve got a winning formula.
Since WordPress pages don‘t come with tags out of the box, our first step is to enable that functionality:
Step 1: Install and activate the free Add Tags and Categories to Pages plugin. Once fired up, you‘ll see the familiar Tags box when editing your pages.
Step 2: Put on your strategy hat π© and brainstorm how you want to link your pages together. For instance, let‘s say you run a recipe website with different categories like "breakfast", "vegan", "gluten-free", etc. You could assign tags to pages within those buckets to create tight content clusters.
Go through your existing pages and tag them up accordingly. Remember, the goal is to create a web of connections πΈοΈ that makes sense for your unique content and audience.
Step 3: Now for the fun part β flexing your coding muscles! πͺ We‘re going to write a custom function that fetches pages with matching tags. You can add this PHP snippet to your theme‘s functions.php file or use a plugin like Code Snippets to keep things tidy.
function wpb_related_pages() {
$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(
‘post_type‘ => ‘page‘,
‘tag__in‘ => $tag_ids,
‘post__not_in‘ => array($post->ID),
‘posts_per_page‘=> 5, // Number of related pages to display
);
$my_query = new wp_query($args);
if($my_query->have_posts()) {
echo ‘<div id="related-pages"><h3>Related Pages</h3><ul>‘;
while($my_query->have_posts()) {
$my_query->the_post();
?>
<li>
<div class="related-thumb">
<a href="<?php the_permalink()?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_post_thumbnail(‘thumbnail‘); ?> </a>
</div>
<div class="related-content">
<h4><a href="<?php the_permalink()?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a></h4>
<?php the_date(‘M j, Y‘); ?>
</div>
</li>
<?php
}
echo ‘</ul></div>‘;
}
}
$post = $orig_post;
wp_reset_query();
}Let‘s quickly break down what this code does:
- Grabs the tags π·οΈ associated with the current page
- Queries the database for other pages with matching tags, excluding the current one β
- Outputs the related pages with thumbnail images, titles, and published dates π
You can customize the posts_per_page parameter to control how many recommendations show up and tinker with the HTML markup to sculpt the perfect presentation.
Step 4: To actually showcase your shiny new related pages, you need to call the wpb_related_pages() function somewhere in your page template. Open up page.php and plop this snippet where you want the links to appear:
<?php wpb_related_pages(); ?>Step 5: Finally, you can sprinkle some CSS magic β¨ to make your related pages look irresistible. Your theme‘s stylesheet is the perfect place for these rules, targeting the classes from the HTML output:
#related-pages {
margin-top: 40px;
}
#related-pages ul {
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: 20px;
list-style-type: none;
}
#related-pages li {
background: #f1f1f1;
padding: 15px;
border: 1px solid #ddd;
} Tweak the styles to match your site‘s design language and brand personality. The sky‘s the limit! π
Related Page Best Practices: Dos and Don‘ts
Whichever path you choose β plugin or bespoke code β these tips will help you wring maximum value from your related pages:
π’ Dos
- Prioritize relevance above all else. Aim for "ooh, that looks interesting!" not "why am I seeing this?" π€
- Entice clicks with compelling visuals πΈ and titles π
- Keep the number of links manageable, usually between 3-6 for optimal focus π―
- Watch your analytics π and continuously refine tags or settings based on what resonates
π΄ Don‘ts
- Don‘t recommend barely-relevant pages just to fill space β¬
- Avoid generic titles like "Related Posts" β get specific and benefit-driven πͺ
- Don‘t go overboard with the number of links. Choice paralysis is real! π΅
- Set it and forget it β° β related pages need ongoing TLC to stay impactful
Related Resources to Explore
While you‘re on this related page kick, why not dive even deeper? Check out these guides for more juicy strategies:
- How to Boost On-Page Engagement with Related Posts π
- Advanced SEO Techniques for Interlinking Your Content π
- 10 Proven Ways to Reduce Bounce Rate and Increase Conversions π
Wrapping Up
Related pages may seem like a small detail in the grand scheme of your WordPress site, but their impact can be profound. By intelligently surfacing your most valuable content, you can transform casual visitors into devoted fans eager to consume everything you have to offer.
Whether you prefer the ease of a plugin or the fine-tuned control of custom code, the principles are the same:
Relevance β
Discoverability β
Engagement β
Use the tools and tactics outlined in this guide to weave a sticky web of connections that keep users hooked and search engines happy. Your pageviews (and bottom line) will thank you! π
Now go forth and relate those pages like a boss π
