Description
Berq Markdown makes your WordPress content instantly consumable by AI assistants, LLM crawlers (GPTBot, ClaudeBot, Googlebot-AI), and Markdown-aware tools — without duplicating your content or creating separate pages.
Appending .md to any public page or post URL (e.g. https://example.com/about.md) returns a clean, structured Markdown file with YAML frontmatter. The plugin handles content from all common sources: Gutenberg blocks, classic editor, shortcodes, and custom PHP templates.
How it works
When a visitor or crawler requests /about.md, the plugin intercepts the request, finds the matching WordPress post, converts the HTML content to Markdown, and serves it with the correct Content-Type: text/markdown header — all without creating any new database entries or files.
Key Features
- Automatic .md URLs — any public post or page URL +
.mdreturns clean Markdown - YAML frontmatter — every .md file includes
title,description,url,date_modified,author, andlanguage - Full content compatibility — works with Gutenberg blocks, classic editor, shortcodes, and custom PHP page templates
- HTML to Markdown conversion — pure PHP, no external dependencies; handles headings, paragraphs, lists, links, images, tables, code blocks, and more
- Internal link rewriting — links to internal pages are rewritten to their
.mdequivalent automatically - URL exclusions with wildcards — exclude specific URL patterns using
*as a wildcard (e.g./cart/*,*/checkout*) - Post type selection — choose which post types (posts, pages, custom post types) are served as Markdown
- Transient caching — optional cache with configurable TTL to reduce server load at scale
<link>tag injection — injects a<link rel="alternate" type="text/markdown">tag in every page’s<head>so crawlers can discover the .md version[btrmd313_md_link]shortcode — renders a link to the current page’s.mdfile, opens in a new tab- Multilingual support — detects language via Polylang or WPML, adds
languageandalternatesto frontmatter and emitshreflanglink tags - Public content rendering — always renders content as a non-logged-in visitor, so member-only sections are not exposed
- Admin settings page — all options configurable under Settings > Berq Markdown, with a Settings link on the Plugins page
Installation
- Upload the
berq-markdownfolder to/wp-content/plugins/ - Activate the plugin through the Plugins menu in WordPress
- Go to Settings > Permalinks and click Save Changes to flush rewrite rules (required once after activation)
- Visit any page URL with
.mdappended — e.g.https://yoursite.com/about.md - Optionally configure the plugin under Settings > Berq Markdown
FAQ
-
Does this create duplicate content?
-
No. The
.mdURLs are separate endpoints that returnContent-Type: text/markdown— search engines treat them differently from HTML pages. The plugin also sendsX-Robots-Tag: noindex, followby default to prevent indexing of the Markdown versions. -
Will it work with my page builder?
-
Yes. The plugin renders content the same way WordPress does for a logged-out visitor — using the full
the_contentfilter chain, which includes Gutenberg blocks and most page builders. For pages using custom PHP templates with nopost_content, it falls back to output-buffering the template and extracting the body content. -
How do I exclude certain pages from .md serving?
-
Go to Settings > Berq Markdown > URL Exclusions and enter one URL pattern per line. Use
*as a wildcard. Examples:/cart/*,*/checkout*,/my-account/. -
Does it work with Yoast SEO?
-
Yes. When Yoast SEO is active, the plugin registers as a custom sitemap provider so your
.mdURLs appear in the Yoast sitemap index. It also reads Yoast’s meta description for the frontmatterdescriptionfield. -
Does it support custom post types?
-
Yes. Go to Settings > Berq Markdown > Post Types and check any registered public post type you want to include.
-
Is caching enabled by default?
-
No — caching is disabled by default so you always see fresh content during development. Enable it under Settings > Berq Markdown > Cache when you are ready to scale.
-
What shortcode is available?
-
[btrmd313_md_link] — outputs a link to the current page’s
.mdversion, opening in a new tab.Optional attributes:
*text— link label (default: “View as Markdown”)
*class— additional CSS class(es)Example:
[btrmd313_md_link text="Read as Markdown" class="my-button"] -
Does it support multilingual sites?
-
Yes. The plugin detects language via Polylang or WPML. It adds a
languagefield to the frontmatter and analternatesblock listing all translated.mdURLs. It also emits<link rel="alternate" hreflang="...">tags in the HTML<head>. -
Does it work with caching plugins?
-
Yes. The plugin serves
.mdfiles before WordPress loads any theme template. Cache plugins that operate at the HTTP level (e.g. full-page caching) may cache.mdresponses — this is fine and actually beneficial for performance.
Reviews
There are no reviews for this plugin.
Contributors & Developers
“Berq Markdown – Markdown Pages for AI & LLM Crawlers” is open source software. The following people have contributed to this plugin.
ContributorsTranslate “Berq Markdown – Markdown Pages for AI & LLM Crawlers” into your language.
Interested in development?
Browse the code, check out the SVN repository, or subscribe to the development log by RSS.
Changelog
1.1.0
- Fix: MD files now served with correct 200 HTTP status (WordPress was setting 404 before template_redirect fired)
- Fix: Home page
.mdURL corrected —/index.mdinstead of brokensite.local.md - Fix:
url_to_postid()trailing slash sensitivity — now tries URL both with and without trailing slash - Fix: PHP template pages with empty
post_contentnow rendered correctly via output buffer - Fix: HTML comments (including Gutenberg block delimiters) stripped from Markdown output
- Fix: Heading whitespace normalized — multi-line headings collapse to a single line
- Fix: Inline tags inside headings stripped to plain text
- Fix: Description frontmatter field no longer wrapped in unnecessary quotes
- Fix: Cache disabled by default — opt-in instead of opt-out
- Fix: WordPress Plugin Check compliance — text domain corrected,
parse_urlwp_parse_url,strip_tagswp_strip_all_tags, variable prefixing in uninstall - Feature: Post type selection — choose which post types are served as
.mdfiles - Feature: Multilingual support —
languageandalternatesfrontmatter fields,hreflanglink tags (Polylang and WPML) - Feature: Internal links inside Markdown output rewritten to
.mdequivalents automatically - Feature:
[btrmd313_md_link]shortcode — renders a link to the current page’s.mdfile - Feature: Template pages rendered as non-logged-in visitor for accurate public content
- Feature: Admin bar suppressed during template output buffering
1.0.0
- Initial release
- .md URL serving with YAML frontmatter
- HTML to Markdown conversion (pure PHP, DOMDocument)
- Gutenberg block, shortcode, and custom template support
- URL exclusions with wildcard support
- Post type selection
- Transient cache with configurable TTL
<link rel="alternate">injection in HTML head[btrmd313_md_link]shortcode- Yoast SEO sitemap integration + generic md-sitemap.xml fallback
- Multilingual support (Polylang, WPML) — language frontmatter + hreflang tags
- Internal link rewriting to .md equivalents
- Non-logged-in rendering for accurate public content
- Admin settings page under Settings > Berq Markdown
