MkDocs and Material docs monitoring
MkDocs builds static HTML from Markdown with a navigation tree declared in mkdocs.yml. Material for MkDocs adds search, tabs and instant navigation, and mike adds versioned deployments. The static output is easy to crawl; the breakage is mostly about navigation drift, heading slugs and versions.
How MkDocs sites typically break
Pages not in nav become orphans. MkDocs still builds a page that is missing from nav and reports "The following pages exist in the docs directory, but are not included in the 'nav' configuration" (validation.nav.omitted_files, an error in --strict mode), but nothing links to it, so it only surfaces from search and slowly loses ranking.
Heading slugs change with heading text. The toc extension generates ids from heading text. Cross-page anchor links break when headings are edited, and Material's permalinks encourage people to copy those links.
Versioned deployments with mike multiply URLs. Each version has its own tree, typically /1.4/, /2.0/ and an alias like /latest/. Pages copied into a new version keep links into the old one, and old versions often lack canonical tags pointing at the latest.
use_directory_urls changes every URL. It defaults to true; toggling it moves pages from /page.html to /page/ or back. Old links and indexed URLs need redirects.
Instant navigation can mask errors. Material's instant loading fetches pages with JavaScript, so what a reader sees when a link breaks can differ from the plain server response a simple checker sees.
What the MkDocs build catches, and what it misses
mkdocs build --stricthalts on any warning, includingvalidation.links.anchors,validation.links.unrecognized_links,validation.links.absolute_linksandvalidation.nav.not_found(each defaults towarn).- Warnings for documentation files not included in
nav. - It misses: external links, anchors targeted from other sites, redirect chains, sitemap drift, soft 404s, duplicate titles across versions, and everything that happens on the live host.
Setting up redirects on MkDocs
The mkdocs-redirects package (plugin name redirects) creates HTML redirect pages at build time:
# mkdocs.yml
plugins:
- redirects:
redirect_maps:
old/page.md: new/page.md
guides/legacy.md: guides/current.md
Keys are the old Markdown paths relative to docs_dir; values are new Markdown paths or external URLs.
These are meta-refresh redirects, which readers follow but search engines treat less reliably than
HTTP 301s. If the site is hosted on GitHub Pages you are limited to this approach; on Netlify,
Cloudflare Pages, nginx or Apache prefer host redirects from the redirect rules cheat
sheet. The migration redirect
checker writes those files for you.
How PathIntact monitors an MkDocs site
- Detection: the
mkdocsgenerator meta tag and Material'smd-class names. Detected sites use the generic redirect formats in fix suggestions. - Render mode:
auto, effectively static. - Versions: mike-style version paths are detected as a
/{version}/pattern; links from the latest version into older ones and canonicals that cross versions are reported. - Sitemap: MkDocs writes
sitemap.xml, typically alongside a gzipped copy; PathIntact reads either, reports non-200 entries, noindex entries, drift and orphans. - Anchors: every
#fragmentlink is compared with the ids on the target page, with closest-match hints when a heading was renamed.
FAQ
- Does MkDocs check links?
- With strict mode, MkDocs fails the build on unresolvable internal links and on documentation files that are missing from nav. It does not check external links, anchors targeted from other sites, or anything after deploy.
- Do MkDocs sites need JavaScript rendering?
- No. MkDocs and Material output static HTML with content present; PathIntact reads them statically.
- How does versioning with mike affect monitoring?
- mike deploys each version under its own path, typically a version number such as /1.4/ plus an alias such as /latest/. PathIntact detects the pattern and reports links from the latest version into older ones.
- What about use_directory_urls?
- With directory URLs on, pages live at /page/; with it off, at /page.html. Keep one convention. Links using the other form show up as links to redirects or broken links depending on your host.
Check a MkDocs site now
Free 50-page crawl with broken links, anchors, orphans and sitemap problems.
Last updated 2026-09-16. MkDocs is a trademark of its owner; PathIntact is not affiliated.