Repository navigation
Put full citation records into Yoast SEO's graph - #254
Conversation
Borges added the cited works to Yoast SEO's Article (or WebPage) piece using the main query's post, so a graph Yoast built for another caller had no citations. NLWeb's WordPress plugin is one: it calls YoastSEO()->meta->for_post() to answer agents over MCP, and its answers lost the citation edge. Found while tracing citation metadata through Yoast and NLWeb on a local site. The Yoast filters now take the post from the context Yoast passes, and bibliography_builder_json_ld_page_url() accepts that post, passing it to its filter as a second argument. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WPtgA2F1J2N3yCPk3cUX1P
get_permalink() takes a WP_Post or an ID, so pass the context post's ID when it is some other object, and declare the context post as an object. docs/current-metrics.md follows the new first-party PHP line count. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WPtgA2F1J2N3yCPk3cUX1P
It already reads any object with post_content; Psalm now accepts the post from Yoast's context there. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WPtgA2F1J2N3yCPk3cUX1P
Yoast's schema aggregator and NLWeb (crawler and WordPress plugin MCP
answers) read only Yoast's graph, where Borges put {@type, @id, name}
stubs, so 12 of 78 traced field values reached them. The Yoast Article
and WebPage filters now embed each cited work's full record, the same
one the ItemList carries, deduplicated by @id and without @context.
The bibliography_builder_yoast_citation_records filter returns to the
short references. Rank Math and the no-SEO WebPage node keep them.
Verified with tools/yoast-nlweb-trace (PR #253): 78/78 at the Yoast
graph, aggregator feed, NLWeb index, and NLWeb MCP answer.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WPtgA2F1J2N3yCPk3cUX1P
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #254 +/- ##
=========================================
Coverage 88.68% 88.68%
Complexity 67 67
=========================================
Files 102 102
Lines 10982 10989 +7
Branches 962 962
=========================================
+ Hits 9739 9746 +7
Misses 445 445
Partials 798 798 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
@codex review Focus areas: the full records embedded in Yoast's Generated by Claude Code |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. Keep it up! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
# Conflicts: # docs/current-metrics.md
…st-context' into claude/project-thread-6zozsp-yoast-records # Conflicts: # docs/current-metrics.md
…-builder into yoast-records # Conflicts: # CLAUDE.md # docs/current-metrics.md # includes/json-ld-enrichment.php # tests/fixtures/function-inventory.txt # tests/phpunit/JsonLdEnrichmentTest.php
|
@codex review Generated by Claude Code |
|
Codex Review: Didn't find any major issues. Delightful! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
In-text and margin citations with Update citations after a style change (#256); annotated bibliographies (#258); h-cite microformats (#257); full citation records in Yoast SEO's graph and Yoast context fix (#252, #254); RIS journal abbreviations; sentence case in Harvard; the Playground demo example of citations and annotations (#259). Claude-Session: https://claude.ai/code/session_01WPtgA1cnwP9mYKwaWniaFS Co-authored-by: Claude <noreply@anthropic.com>
Requested by Dan · project thread
Stacked on #252 (base is its branch); retarget to
mainonce #252 merges.Summary
Dan chose "Embed records in citation" after the trace in #253. Yoast's schema aggregator and NLWeb (its crawler and its WordPress plugin's MCP answers) read only Yoast's graph, where Borges put
{@type, @id, name}stubs, so only 12 of 78 traced field values reached them.bibliography_builder_get_cited_works()returns each cited work's full enriched record, the same one theItemListcarries, deduplicated by@id, without@context, and cached per request.bibliography_builder_get_cited_work_refs()now maps those to stubs.bibliography_builder_yoast_cited_works(), renamed from…_yoast_cited_work_refs()in Read the post from Yoast's context when adding citations #252) embed the full records.bibliography_builder_yoast_citation_records(defaulttrue); returningfalserestores the short references.WebPagenode keep the short references. Rank Math can follow if Dan wants it; I have no evidence about what reads its graph.Validation
composer test:php: OK (715 tests). Newtest_yoast_citations_carry_full_recordschecks records match theItemListitems by@id, carry no@context, and fall back to stubs when the filter returns false.phpcsclean; Psalm "No errors found";verify-metrics.shgreen (PHP line count updated).tools/yoast-nlweb-tracefrom Trace citation metadata through Yoast SEO and NLWeb #253 on WordPress 7.1.4 + Yoast 28.8 + NLWeb b423f15:Checklist
save()unchanged, so no deprecationGenerated by Claude Code