Before 1.8.1: Bigram Title Search
- Title parsing into bi-grams, cleaned and normalized by locale.
- search-core ran weighted queries (title, title_tag, title_excerpt…), merging results by score.
- Deterministic output, consistent and strong for semantically rich titles.
Limitations: heavily title-dependent; lacked time and engagement signals; low diversity when many posts were near-duplicates.
1.8.1: Introducing [init_live_search_related_ai] (multi-signal)
- Signals: tag, series, title bigrams (cosine), same_keyword (ACF), category, views, comments, freshness.
- Candidate pool: expanded from recent posts, same series, and
same_keywordmetadata; extendable via filters. - Templates: reuses existing
related-posts-*.phptemplates, no new CSS required. - Filter API:
ai_candidates,ai_signals,ai_weights,ai_score.
1.8.2: AI Related Posts Engine v2
- Algorithm v2 with explicit cache versioning for safe invalidation.
- Freshness replaced by two distinct signals: recency (vs. now) and time_gap (vs. source post).
- MMR diversification: balances relevance and diversity, avoiding near-duplicate results.
- Performance: auto-filter publish status, deduplicate, pre-cache posts/meta/terms, optimized scoring loop with safe weighted RNG.
- New filters:
ai_half_life_recency,ai_half_life_gap,ai_mmr_lambda,ai_selected.
Quick comparison
- Legacy Related (
related_posts): bigram-based, precise when titles are strong, deterministic and fast. - AI Related (
related_ai): multi-signal, context-aware (taxonomy, engagement, time), results both relevant and diverse.
Usage
Bigram (legacy, still supported):
[init_live_search_related_posts count="6" template="default"]
AI (recommended):
[init_live_search_related_ai count="6" post_type="post" template="default" css="1" schema="1"]
- count: number of posts
- post_type: post types
- template: reuses existing
related-posts-*.php - css/schema: toggle CSS and schema output
Developer filters (core)
init_plugin_suite_live_search_ai_candidates: add/replace candidate pool (ACF, taxonomy…)init_plugin_suite_live_search_ai_signals: extend/override signals (e.g., same author boost)init_plugin_suite_live_search_ai_weights: adjust weights (core normalizes)init_plugin_suite_live_search_ai_score: tweak final candidate scoreinit_plugin_suite_live_search_ai_half_life_recency,init_plugin_suite_live_search_ai_half_life_gap: control decay of time-based signalsinit_plugin_suite_live_search_ai_mmr_lambda: balance relevance vs. diversityinit_plugin_suite_live_search_ai_selected: override or reorder final selection after MMR
Migration notes (1.8.1 → 1.8.2)
- If you previously weighted
freshness, switch torecencyandtime_gapinai_weights. - Templates and shortcode builder remain unchanged; no UI updates required.
- Tune
ai_mmr_lambdato increase or reduce output diversity.
Conclusion
AI-Powered Related Posts takes related content beyond bigram matching: multi-signal scoring, time-aware decay, and MMR diversification. With [init_live_search_related_ai], you keep your templates, gain more accurate and diverse results, and have complete extensibility through filters—all with minimal overhead.
Comments