Umay AI Markdown
Modern AI agents (ChatGPT, Claude, Perplexity, Gemini, etc.) work much better with Markdown than HTML. Umay AI Markdown inspects the incoming Accept header and, only when text/markdown is requested, intercepts the response and serves a clean, agent-friendly Markdown representation of the page.
Browsers, search engines, and any client that does not explicitly ask for Markdown receive the unchanged HTML response. There is no settings page, no cron job, and no external service call.
Key features
- Zero configuration — install, activate, done.
- Only triggers when
Accept: text/markdownis present. Regular visitors and search engines are never affected. - Hybrid content extraction: uses
the_contentfor posts/pages, falls back to a DOM-based extractor for archives, taxonomies, and the homepage. - Powered by the industry-standard league/html-to-markdown library.
- Transient-cached for 12 hours per URL (sha256-keyed). Auto-invalidated on
save_post, term edits, theme switches, and menu updates. - Built-in IP rate limiter (30 requests / minute by default) to mitigate abuse.
- Strict input sanitization, header injection protection, libxml entity hardening (XXE-safe), and full WordPress Coding Standards compliance.
- PSR-4 autoloaded, namespaced OOP code. No globals.
- Sends
Vary: Accept,X-Robots-Tag: noindex, andX-Content-Type-Options: nosniffon every Markdown response.
What gets sent to AI agents
Each Markdown response includes a YAML front-matter block with the page title, site name, canonical URL, and ISO-8601 generation timestamp, followed by the page body converted to Markdown. Navigation, footer, sidebars, scripts, styles, comment forms, related posts, and other page chrome are stripped before conversion.
Filters
Two filters are available for advanced customization:
umay_mdn_bypass— Returntrueto skip Markdown handling for the current request.umay_mdn_cache_ttl— Override the default 12-hour cache lifetime (in seconds, minimum 60).umay_mdn_rate_limit— Override the default 30-requests-per-minute rate limit.umay_mdn_converter_options— Modify the league/html-to-markdown converter options array.
