Related Posts by Taxonomy
Related Posts by Taxonomy
Description
Quickly increase your readers’ engagement by adding related posts in the sidebar or after post content with a widget or shortcode.
Posts with the most terms in common will display at the top!
This plugin is capable of finding related posts in multiple taxonomies and post types. Include or exclude terms from the search for related posts. Change the look and feel by using your own templates in a (child) theme.
Plugin features:
- Widget and Shortcode.
- Display related posts as post thumbnails, links, excerpts or full posts.
- Small Footprint. Doesn’t slow down your site!
- Automatic display of related posts after the post content.
- Exclude or include terms and posts.
- Search for related posts in single or multiple taxonomies and post types.
- Limit the search for related posts by date, number or post meta.
- Use your own HTML templates for display of the related posts.
- Extensive plugin documentation.
- Follows WordPress coding standards and plugin best practices.
- Highly Adjustable!
For the following features you need to be somewhat familiar with WordPress hooks. The plugin documentation has many examples to help you along.
Extended features:
- Use a persistent cache for the related posts query. (opt-in feature)
- Use the WordPress REST API to get related posts. (opt-in feature)
- Load related posts after the whole page has loaded (with Ajax). (opt-in feature)
- Use plugin functions in your theme templates to display related posts yourself.
- Use Filters to change the default behavior of the plugin.
Follow this plugin on GitHub.
Search the code reference
See the FAQ to have related posts automatically display after the post content without using the shortcode or widget.
Default usage for the shortcode is:
[related_posts_by_tax]
Attributes for the shortcode are:
post_idtaxonomiespost_typesposts_per_pageorderorderbybefore_shortcodeafter_shortcodetitleshow_datebefore_titleafter_titleinclude_termsinclude_parentsinclude_childrenexclude_termsexclude_postsformatgallery_formatimage_sizecolumnscaptionlink_captionlimit_postslimit_monthmeta_keymeta_valuemeta_comparemeta_typepublic_onlyinclude_selfpost_class
Example to show 10 related posts instead of the default 5.
[related_posts_by_tax posts_per_page="10"]
See the documentation for more information about these attributes.
Translations
- Dutch
- French (by Annie Stasse)
- Spanish (by Ludobooks – Cuentos personalizados)
- Catalan (by Ludobooks – Cuentos personalizados)
- Polish (by koda0601)
Installation
- Unzip the
related-posts-by-taxonomy.zipfolder. - Upload the
related-posts-by-taxonomyfolder to your/wp-content/pluginsdirectory. - Activate Related Posts by Taxonomy.
- That’s it, now you are ready to use the widget and shortcode
Screenshots
Faq
For more information about the plugin see the plugin documentation.
To customize this plugin see the plugin recipes page.
Yes. Review this section of the documentation to style the related posts yourself.
Review Adding Related Posts After the Post Content.
Yes. For the widget see this filter and for the shortcode see the attributes include_terms, exclude-terms and exclude_posts.
Yes. Review Setting your own defaults for the shortcode
Yes. See this filter on how to do that.
- This plugin doesn’t process, share, send or retain any user data.
- This plugin doesn’t track (user) data for analytics (or for any other reason).
- This plugin doesn’t save or read cookies.
- This plugin doesn’t use 3rd party libraries.
Read this article why plugin authors cannot guarantee 100% compliance.
Please contact a GDPR consultant or law firm with this information to assess if this plugin is compliant.
Reviews
My goodness!
By Gaurav Tiwari (gauravtiwari) on December 9, 2024
How on the Earth did I miss this related posts plugin? Maybe the name is too niche but it is a wonderful "allrounder" plugin.
A six-stars out of five — tool.
Rocking it on my primary website and soon to be added to all my client sites.
Very well done and thanks for the documentation. Helps a fellow developer.
Always a pleasure to use
By SomniumLucidus on September 1, 2023
After having repeatedly tried and dumped a heap of plugins that didn't quite do what they should—or needed convoluted work in order to do so—, what a relief it is to finally installing this plugin!
I was wondering why I had chosen this one for a previous website I put together a while ago, and now I understand.
A moment of silence for a once great plugin...
By laceybeach on July 10, 2022
Great Plugin!
By (zignorp) on March 3, 2022
Light Related Posts plugin for WordPress
By SamX (techlector) on April 20, 2021
Pretty good
By mikoba on December 2, 2020
Thanks
By blade1407 on April 27, 2020
Perfect
By Etienne Juneau on April 27, 2020
Works great. Polite, prompt dev.
By asknlearn on July 12, 2019
Simply simple and worked just like charm!
By dadaogbegun on March 27, 2019
Changelog
2.7.6
- Enhancement
- Add a filter to use any theme directory for custom related posts template files
2.7.5
- Enhancement
- Fix PHP 8 and up deprecated notices
2.7.4
- Enhancement
- Update the block gallery with the HTML changes made in WordPress 5.4 (again!).
- Use post title for aria-label only
- Display cache log in footer (because admin_bar_menu hook changed to wp_body_open)
- Getting ready for WP 5.5 (updating deprecated functions)
2.7.3
- Enhancement
- Make the no posts found message filterable.
- Update gallery with the HTML changes made in the WordPress 5.3 gallery.
- Add accessibility to the gallery item element.
- Deprecated
- The ‘terms’ and ‘related’ arguments are deprecated in favor of the ‘include_terms’ argument.
- The ‘include_terms’ argument now uses the included terms without any restrictions.
- The default value for the ‘related’ argument changed from boolean true to null.
- Set the ‘related’ argument to boolean true to have the old restrictions back.
- The ‘terms’ and ‘related’ arguments are deprecated in favor of the ‘include_terms’ argument.
2.7.2
- Bug Fixes
- Fix for gallery image (fallback) filter not being reached.
- Sanitize Rest API rendered HTML with wp_kses_post().
2.7.1
- Enhancement
- New format for related galleries similar to the Gutenberg gallery block.
- Include child or parent terms for the related posts query.
- Filters for Widget defaults and instance.
- Bug Fixes
- (minor) Don’t default to all public taxonomies if no valid taxonomies are used.
2.6.0
- Enhancement
- Meta query
- Allows you to query related posts with post meta
- Use meta arguments in the shortcode
- Use a filter for the widget or for complex meta queries
- ID query
- Allow queries for post IDs only. (for the related posts in the widget and shortcode templates)
- Speeds up the related posts query. (not activated by default because of back compatibility)
- Please read the documentation about query optimization before using this feature
- Lazy loading (opt in feature).
- Speeds up perceived page load time for very large sites
- Does the query for related posts (with Ajax) after the page is loaded
- Recommended for related posts below the fold.
- Detect post type Page taxonomies
- Preparing the plugin for the (Gutenberg) editor block feature
- Meta query
2.5.1
- Enhancement
- Add ability to show the post date after the post title
- Allow getting post fields from the cache
- Add new filter to filter all related post permalinks
- Add new tests for the post type feature (GitHub)
- Bug fixes
- (minor) Add post classes after retrieving posts from the cache
- (minor) Return an error if invalid taxonomies or post types was requested with the WP Rest API
2.5.0
- Enhancement
- Prepare plugin for gutenberg blocks
- Add ‘terms’ parameter for shortcode and widget
- Add GDPR information to readme.txt
- deprecate functions (with back compatibility)
- km_rpbt_related_posts_by_taxonomy()
- km_rpbt_get_default_args()
- km_rpbt_related_posts_by_taxonomy_validate_ids()
- km_rpbt_related_posts_by_taxonomy_template()
- km_rpbt_post_title_link()
- km_rpbt_get_related_post_title_link()
- km_rpbt_related_posts_by_taxonomy_widget()
- Bug fixes
- (minor) Add missing filter pre_related_posts before cache queries
- (minor) Add missing properties to related posts returned by the cache
For older changelog versions see the changelog.txt file



