Google Is Indexing Your .md Pages: Why It Happens and How to Fix It
What to do when Google Search Console shows your pages indexed twice — once as the normal page, once as its .md Markdown version.
Google indexes both /my-post/ and /my-post.md
Symptom. Search Console’s Pages report (or a site:example.com search) shows the same content indexed at two URLs: the normal page and a plain-text .md variant. Sometimes the .md version even appears in search results, showing raw Markdown to visitors.
Why this happens. Waggle publishes a Markdown version of every page (append .md to any URL) so AI assistants can read your content cleanly. In Waggle versions up to 1.0.0, those .md URLs were also listed in your XML sitemap, and the .md response relied on a Link: rel="canonical" header alone to tell search engines “the real page is the HTML one.” Google treats a canonical header as a hint, not a rule — and treats a sitemap listing as a vote for indexing. With the two versions’ content differing (Markdown vs. HTML), Google sided with the sitemap and indexed both.
How to confirm.
- In Search Console, open URL Inspection and inspect any
.mdURL — if it says “URL is on Google,” you’re affected. - Or search Google for
site:example.com inurl:.mdand look for plain-text results. - Check what your site currently serves:
curl -sI https://example.com/some-post.md | grep -i 'x-robots-tag|link'On a fixed site you’ll see both
X-Robots-Tag: noindexand theLink: <…>; rel="canonical"header. IfX-Robots-Tagis missing, you’re on the affected version.
Fix.
- Update Waggle past 1.0.0. The update does two things at once:
.mdURLs leave your sitemap (it goes back to normal pages only), and every.mdresponse sendsX-Robots-Tag: noindex. AI assistants still find and read the Markdown — it stays listed in yourllms.txt, and every page keeps its<link rel="alternate">pointer — but search engines are now explicitly told to drop it. - Let Google clean itself up. As Google recrawls each
.mdURL it sees the noindex and removes it from the index. This takes days to a few weeks depending on crawl rate. In Search Console the Pages report’s “Excluded by ‘noindex’ tag” count will grow as the duplicates drain out — that’s the fix working. - For anything embarrassing right now, use Search Console → Removals → New request with the
.mdURL (or the.mdprefix) to hide it from results immediately while the recrawl catches up. - Do not block
.mdin robots.txt. It feels like the stronger move, but a blocked URL can stay in the index (“indexed, though blocked by robots.txt”) because Google can no longer see the noindex. Let the noindex do its job — and blocking would also cut off the AI crawlers the Markdown exists for.