Contextual Related Posts v3.5.0 and introducing Contextual Related Posts Pro
I first released Contextual Related Posts on 21 January 2009. It has been a free plugin for over 15 years, available to download and install from the official WordPress plugin repository. I am pleased to announce that after over 15 years, I have released Contextual Related Posts Pro to coincide with the release of version 3.5.0.
Contextual Related Posts is feature-rich. The plugin offers automatic display after your content, but you can also manually place it using functions. It supports the Block Editor, provides widgets for sidebar or footer placement, and even offers a shortcode. Additionally, you can exclude specific posts or categories, customise the output with CSS, and benefit from caching for improved performance. If you’re looking to keep visitors on your site longer and encourage exploration of your content, Contextual Related Posts is an excellent choice!
Why CRP Pro
WordPress celebrated its 21st anniversary last month, and over the past 5 years, there has been significant development in the block editor, particularly its use for full site editing (FSE). This progress has necessitated changes to Contextual Related Posts. Although I initially introduced the Contextual Related Posts block in December 2019, the ongoing evolution called for a more sophisticated block.
The Contextual Related Posts Query Loop Block
Enter Contextual Related Posts Pro which I’ve been working on over the past few months. CRP Pro brings a new Related Posts Query Loop Block. It allows you to dynamically retrieve and display related posts, pages, or custom post types based on specific criteria. By configuring settings like post type, filters, order, and layout, you can create dynamic content that automatically updates as your site evolves.
This block is easy to use and also adds an amazing degree of control to the layout of the related posts. You can choose from a set of pre-made patterns or create your own.
If you choose to make your layout, you can add core blocks like the post title, excerpt, featured image, etc. You can also add custom blocks from other plugins e.g. a headline block or button. Perfect to get your related posts to fit seamlessly within your site.
Set Weights for better matching
CRP Pro also introduces a weighting system that enables users to assign different weights to the post title, post content, and post excerpt when determining relatedness. You will find new settings under the List Tuning tab which allow you to assign the different weights.
Extra Shortcode and Metabox options
CRP Pro v3.5.0 introduces an enhancement to the related posts’ shortcode functionality with the addition of the display_only_on_tax_ids
parameter. When utilised within a template, the shortcode will conditionally display related posts only on the pages of the specified taxonomy terms. Works for categories, tags or any custom taxonomy.
It also adds an extra setting to the Edit Post meta box which is mapped to include_cat_ids
. This option is designed to refine the display of related posts by exclusively including those from designated categories.
The Clear Cache button
CRP Pro adds a Clear Cache button at the bottom of the settings screen next to your Save settings buttons. Save a click or more; a second or more.
Enhanced sorting when using the same taxonomy
If “Only from” same category/tag/taxonomy is enabled, the plugin will sort results by the number of matched taxonomies first, thereby optimising the related posts further.
If you’re using both the fulltext match and the above option, then it will first sort by relevance and then by the number of common taxonomies.
The free version has no change in functionality and will continue to either sort by relevance or date.
What’s new in Contextual Related Posts v3.5
It’s not just Pro features in version 3.5.0. Contextual Related Posts v3.5.0 is a complete code rewrite, moving from functional programming to using classes and autoloading, similar to the last few code rewrites that I have undertaken.
Insert Related Posts automatically from the bottom
By default, the related posts are inserted at the end of the post content. The “Insert after paragraph number” setting allowed you to insert this after a specific paragraph number.
You can now enter a negative number in the “Insert after paragraph number” setting to insert the related posts from the bottom of the post.
However, note that this setting ignores headings and hence can disrupt your content. A cleaner way, should you choose to do this manually, is to use the shortcode or the Gutenberg block.
Other improvements in 3.5.0
These are a few additional changes in version 3.5.0 in the free version of the plugin.
- Direct Support for WP_Query:
- In this release, the plugin now directly supports the powerful
WP_Query
class. If you’re familiar with custom queries in WordPress, you’ll appreciate this enhancement. - Specifically, if you set the
crp_query
parameter in your query arguments, the plugin will useWP_Query
to retrieve related posts. This opens up more possibilities for advanced filtering and customisation.
- In this release, the plugin now directly supports the powerful
- Optimised Media Handler:
- We’ve fine-tuned the featured thumbnail selection process to reduce the number of database queries. When fetching related posts, the plugin now handles media (such as featured images) more efficiently.
- This optimisation ensures smoother performance, especially on sites with a large number of posts or complex media attachments.
- Cache ON by Default:
- In 3.4.0, Cache HTML Output was set to
true
by default. This is to ensure performance is a priority. - The Cache Posts Only setting is now also set to
true
by default. If you’re already using the plugin, you won’t see any change. However, if you reset the settings or install a fresh version of the plugin, the cache will be turned on.
- In 3.4.0, Cache HTML Output was set to
There are also a few bug fixes and a huge number of optimisations across the plugin.
Integration with Freemius: Enhancing Licensing and Analytics
Contextual Related Posts v3.5.0 has recently made an important update by integrating with Freemius, a platform that provides licensing, analytics, and user management services for WordPress plugins.
Freemius handles the licensing of the pro version. If you’re using the free plugin, you can upgrade directly from within your WordPress Admin area. Alternatively, buy it here.
Free users can also choose to opt into sharing analytical data with Freemius (and in turn us). This allows us to better understand where the plugin is used.
Pricing
Contextual Related Posts Pro is available for $49 (plus VAT) for a single site license. Alternatively, you can buy the Pro Multi plans to buy a license for 5, 15 or 25 sites. We also offer an Agency plan that allows you to use the plugin on unlimited sites.
For a limited time, you can purchase the Contextual Related Posts at a discounted rate to celebrate the launch.
Use Coupon code EarlyAdopter20 to get a 20% discount on any plan for the first year
I hope you are as excited as I am about this release. If you have any questions about Contextual Related Posts Pro, drop us a line.
The last free version allowed related posts to be drawn from the SAME category using 1 or more matching terms. Is the NEW PRO version going to retain that same setting ability? From the description it sounds like related posts will still draw from the same category, but will sort by date, instead of finding matching terms?
A little clarification. My site doesn’t warrant a paid anything yet, google is in brutal mode for small publishers now.
There is no change in the free version features from earlier. You still can get it out of the same categories (tags etc) as earlier. You’ll see the options haven’t changed for that. These were sorted by the most recent first.
However in the pro version, I’ve added extra logic to prioritise posts with more overlapping categories instead of just date.