Rotproof

Check a MkDocs site for broken links

Rotproof checks every link on a website on a schedule and emails you when one breaks. This page is about using it on a site built with MkDocs: what MkDocs already checks for you, what it leaves out, and what to set up first.

Check your site's first 25 pages free. No account, and nothing is emailed.

What MkDocs checks itself

mkdocs build warns when a link between your Markdown files points at a file that doesn't exist, and --strict turns those warnings into a failed build.

Recent versions can also warn about a link to a heading that doesn't exist, through the validation settings in mkdocs.yml. This applies to Material for MkDocs too, which builds with MkDocs.

What that leaves out

MkDocs doesn't request links to other websites, so a link to someone else's page is never checked.

The larger gap is time. A build checks your links on the day you build. A page you linked to last year can be deleted, moved or sold next month, and nothing in your own repository changes when it does. Nobody finds out until a reader does.

How Rotproof reads a MkDocs site

MkDocs writes plain HTML files, so your links are in the HTML your server sends and Rotproof can read them, the free check included.

MkDocs writes a sitemap.xml with every build. Set site_url in mkdocs.yml so the addresses in it are complete, and Rotproof finds your pages from it.

The free check reads your home page and up to 24 more pages from your sitemap, and checks up to 300 links on them.

What it checks, and how

From one check to a schedule

The free check is a single look at 25 pages. With a free account, Rotproof checks up to 500 pages every week and emails you when a link breaks or starts working again. Paid plans check daily.

Checking on a schedule needs proof that the site is yours. That's one DNS record, added wherever you manage your domain. If you can't add DNS records, as on a github.io or readthedocs.io address, it's a tag in your home page's <head> instead. The tag works for a site with a host name of its own, such as name.github.io. A site in a folder of one, such as name.github.io/project, can have the free check but not a schedule.

Before a change is published

If the site is built on GitHub, the build check reads each proposed change as it would be published, and lists the broken links it adds, links to other websites included, before anyone can follow them. It's free on every plan.

Other documentation tools

The same notes for Docusaurus, Sphinx, VitePress and mdBook.