{
  "id": 17577086,
  "title": "Find Broken Pages on Your Site From Its Sitemap, With One Python File",
  "url": "https://urgent.news/2026/11/01/find-broken-pages-on-your-site-from-its-sitemap-with-one-python-file",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-11-01T10:02:22.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/robinberaud/find-broken-pages-on-your-site-from-its-sitemap-with-one-python-file-557f"
  },
  "original_language": "en",
  "account": "After a website migration or redesign, an outdated sitemap may still include URLs that no longer exist or redirect visitors elsewhere. Search engine crawlers detect these broken links before they become apparent to site owners and their users. While online link checker tools are available, many impose limits on the number of pages they can test, require account registration, or cannot be automated. The reporter sought a simple solution they could run in a terminal or as part of a scheduled job to catch these issues without delay. Thus, they created a Python script called sitemap-link-checker within the Hermes skill framework. This script reads a sitemap file in plain text, gzip format, or as an index of multiple sitemaps, and sends a HEAD request to each listed URL. If a server refuses the HEAD request, it automatically switches to a GET request. The script then reports any broken URLs and redirects found during the scan. With the additional --links flag, it goes a step further by opening each webpage and examining its outbound links, noting which page each dead link was discovered on. The reporter executed the script using the command \"python3 scripts/sitemap_check.py https://example.com/sitemap.xml --links --max-urls 50,\" which successfully identified 1 broken page (404 error) and 1 redirected URL (301 redirect) out of the 3 sitemap URLs tested. The script exits with a status code of 1 if any broken links are detected, making it easy to incorporate into automated job scheduling. A local server test feature called --selftest is included, which sets up a test environment with a 404 error page, a redirect, and a dead link to ensure the checker properly identifies all three types of issues. However, the tool has some limitations: it can only detect broken links listed in the provided sitemap, does not follow JavaScript-rendered links, and some websites may reject script-based requests by returning a 403 error. To run the checker, one must have permission to test the website as the tool will not function on sites they are not authorized to access. The sitemap-link-checker script is released under the MIT open-source license in the Hermes-skills GitHub repository, allowing anyone to freely use, modify, and distribute the tool.",
  "summary": "After a migration or redesign, the sitemap often keeps listing URLs that now return a 404, or that bounce through a redirect. Search engines notice before you do, and so do visitors. Online link checkers work, but many cap the page count, want an account, or can't be scripted. I wanted something I could run from a terminal or a cron job and trust to fail loudly. So I wrote a Hermes skill,…",
  "key_points": [
    "Python script 'sitemap-link-checker' scans sitemaps for broken links",
    "Detects 404 errors, 301 redirects, and dead links in one run",
    "MIT open-source license available on Hermes-skills GitHub repository"
  ],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}