WPProAtoZ Use YARPP as Query for Elementor Related Posts
This plugin integrates YARPP (Yet Another Related Posts Plugin) with Elementor Posts/Loop widgets. It overrides the default query for any widget with Query ID "yarpp_related" to display truly relevant related posts based on YARPP's advanced algorithm (content similarity, tags, categories, etc.). Ideal for single post templates to show
by WPProAtoZ.com · github.com/ahkonsu/wpproatoz-yarrp-for-elementor-query · website
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/ahkonsu/wpproatoz-yarrp-for-elementor-query/archive/refs/heads/main.zipDeclares an update source (https://github.com/Ahkonsu/wpproatoz-yarrp-for-elementor-query/releases), so updates arrive through the plugin's own updater.
Readme
WPProAtoZ YARPP for Elementor Related Posts Query
A lightweight WordPress plugin that integrates YARPP (Yet Another Related Posts Plugin) with Elementor Pro's Posts/Loop widgets. It overrides the default query using a custom Query ID to display smarter, algorithm-based related posts on single post templates.
Overview
Elementor's built-in related posts (via taxonomy terms) can be basic. This plugin swaps that out for YARPP's powerful content-similarity engine (analyzing titles, body text, tags, categories, etc.) — giving visitors more relevant suggestions and improving engagement/SEO.
Just set the Query ID to yarpp_related in your Elementor widget, and the magic happens automatically.
Features
- Leverages YARPP's advanced scoring for truly relevant related posts
- Respects your global YARPP settings (thresholds, weights, etc.) by default
- Automatically excludes the current post
- Easy code-level customization: change post limit, weights, post types
- Fallback to empty results (or recent posts — editable in code) if no matches
- No admin settings page needed — keep it simple and lightweight
- Recursion-safe: prevents infinite loops on non-single pages
Short & sweet usage: Add a Posts widget to your Single Post template, set Query ID ? yarpp_related, and style as usual.
Installation
- Download the latest ZIP from the Releases page.
- In WordPress: Plugins > Add New > Upload Plugin ? upload and activate.
- Ensure Yet Another Related Posts Plugin (YARPP) and Elementor Pro are installed and active.
- Configure YARPP settings at Settings ? Related Posts (tune thresholds, weights for best results).
Usage
- Go to Elementor ? Theme Builder ? Single Post (or create/edit your single post template).
- Add a Posts widget (or Loop Grid / Loop Carousel).
- In widget settings ? Content tab ? Query section:
- Set Query ID to:
yarpp_related(case-sensitive, no quotes).
- Set Query ID to:
- Customize display: thumbnails, titles, excerpts, read more, etc.
- (Optional) Edit the plugin file (
wpproatoz-yarrp-for-elementor-query.php):- Change
'limit' => 4to your preferred number. - Adjust
'post_type' => 'post'for CPTs. - Add weight overrides, e.g.:
'weight' => array('title' => 1, 'body' => 2, 'tax' => array('category' => 1, 'post_tag' => 3)),
- Change
View any single post — the widget now pulls YARPP-powered related posts! Requirements
WordPress 6.0+ PHP 8.0+ Yet Another Related Posts Plugin (YARPP) Elementor Pro (for Posts/Loop widgets and Theme Builder)
Frequently Asked Questions
What if no related posts are found? The widget shows nothing by default (clean look). Edit the code to fallback to recent posts if preferred: // In the else block: $query->set('orderby', 'date'); $query->set('order', 'DESC'); $query->set('posts_per_page', 4);
Can I use this with custom post types?
Yes! Change 'post_type' => 'post' in the code to your CPT slug (or array for multiples). Ensure YARPP supports the post type in its settings. How do I change the number of posts or tweak relevance? Edit 'limit' => 4 or add YARPP args like 'weight' / 'threshold' directly in the function. Tune global YARPP settings first for best baseline. Changelog 1.0.0 (Initial Release)
Integrates yarpp_get_related() with Elementor's custom query filter (elementor/query/yarpp_related).
Uses Query ID: yarpp_related. Includes recursion protection (static flag) to avoid stack overflows. Basic fallback handling and current post exclusion. Lightweight — no admin UI, just code tweaks as needed.
Contributing
Contributions are welcome!
Fork the repo: https://github.com/Ahkonsu/wpproatoz-yarrp-for-elementor-query Create a branch, make changes, submit a PR. Report bugs or suggest features via Issues.
License
GPLv2 or later. See the plugin header or GNU GPL v2 for details. Made by WPProAtoZ.com Donate: https://wpproatoz.com/donate/
Read the full README on GitHub →
Releases
| Tag | Published |
|---|---|
| v1.0.0 | Mar 18, 2026 |
These releases are tags only. The author does not attach a packaged zip, so there are no download counts to report.