Skip to content

Integrate with Yoast SEO llms.txt to use .md URLs#4

Draft
ilicfilip wants to merge 1 commit intomainfrom
filip/yoast-llms-txt-integration
Draft

Integrate with Yoast SEO llms.txt to use .md URLs#4
ilicfilip wants to merge 1 commit intomainfrom
filip/yoast-llms-txt-integration

Conversation

@ilicfilip
Copy link
Contributor

Summary

  • When Yoast SEO's llms.txt feature is active, rewrites post/page URLs to .md versions
  • Wraps Yoast's generation triggers (option toggle, settings change, weekly cron) with wpseo_canonical, post_link, page_link, and post_type_link filters at priority 9/11 around Yoast's priority 10
  • Only loaded when Yoast SEO is active (WPSEO_VERSION check on plugins_loaded)
  • Respects the markdown_alternate_supported_post_types filter — only rewrites URLs for registered post types

Addresses the feature request in #1. The CPT .md URL bug reported in the comment is a separate fix in #3.

Test plan

  • Enable Yoast SEO's llms.txt feature
  • Verify /llms.txt contains .md URLs for posts and pages
  • Verify .md URLs in llms.txt resolve to markdown content (200)
  • Verify non-post URLs (categories, sitemap) are unchanged
  • Verify products and other unsupported post types are unchanged
  • Disable Yoast SEO and verify plugin still works without errors

🤖 Generated with Claude Code

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>
@jdevalk
Copy link
Member

jdevalk commented Feb 17, 2026

Consolidation note: keep this integration PR isolated while URL/rewrite fixes/refactors settle (#8/#9 and RewriteHandler refactors).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants