↑ ↓ select, Enter open, Esc close

Check the status code of all sitemap.xml URLs in parallel

Adjust the values, the command updates live
user@server
curl -s https://example.com/sitemap.xml | grep -oP '(?<=<loc>)[^<]+' | xargs -P 8 -I{} curl -o /dev/null -s -w '%{http_code} %{url_effective}\n' {} | grep -v '^200 ' | sort

Checks all sitemap URLs with several concurrent requests and lists only those deviating from 200, with their status code. A clean sitemap contains only indexable pages with status 200, redirects and error pages in it waste crawl budget. No output means everything is fine.

Note: Choose the parallelism carefully, on weak servers or behind a WAF too many concurrent requests trigger blocks. For an arbitrary URL list from a file, replace curl -s ... | grep with cat datei.txt.

Also searched as

  • check sitemap for 404 errors
  • sitemap contains redirects
  • status codes of all sitemap urls
  • find broken urls in sitemap

Related one-liners

All in SEO checks

Read first, then run.

The commands on myline.de act directly on servers, files and databases. A wrong path or placeholder can delete data irreversibly or make a server unreachable.

  • All commands are provided without warranty and are not tested on every system.
  • Understand what a command does before running it, and check every placeholder.
  • Make a backup first and, if possible, try it on a test system.
  • You run commands at your own risk. Liability for damages is excluded to the extent permitted by law.