Integrate with Yoast SEO llms.txt to use .md URLs#4
Conversation
When Yoast SEO's llms.txt feature is enabled, post/page URLs in the generated file now point to .md versions instead of HTML URLs. This follows the llms.txt spec recommendation to link to clean markdown. The integration wraps Yoast's generation triggers (option changes, cron) with permalink filters at priority 9/11 around Yoast's priority 10, so URLs are rewritten inline during generation with zero file I/O overhead. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
I have tested this PR and as far I can see it is working, at least from our end. While testing this PR, I found that after changing the permalink structure (e.g. to /%postname%/), the URLs in llms.txt become empty, example post: This is a Yoast SEO issue, not caused by our plugin. Root cause When the permalink structure changes, Yoast's However, Yoast does not re-trigger
So if How to reproduce
|
Summary
.mdversionswpseo_canonical,post_link,page_link, andpost_type_linkfilters at priority 9/11 around Yoast's priority 10WPSEO_VERSIONcheck onplugins_loaded)markdown_alternate_supported_post_typesfilter — only rewrites URLs for registered post typesAddresses the feature request in #1. The CPT
.mdURL bug reported in the comment is a separate fix in #3.Test plan
/llms.txtcontains.mdURLs for posts and pages.mdURLs in llms.txt resolve to markdown content (200)🤖 Generated with Claude Code