Find broken links on a website with wget --spider
find broken links command line | wget spider broken link check | find 404 links on website linux | crawl website for dead links | wget | broken-links | 404 | crawling | seoLC_ALL=C wget --spider -r -l 2 -nd -nv -w 1 -o /tmp/spider.log https://example.com/; grep -A 100 'broken link' /tmp/spider.logFollows all links up to the given depth, only checks whether they are reachable and writes the log to a file. At the end, all unreachable URLs are listed under “Found N broken links”. Internal 404s waste crawl budget and hurt the user experience.
Note: -w 1 waits one second between requests, so large sites take a while. wget respects robots.txt, so disallowed areas are not checked. LC_ALL=C forces English messages so that grep matches.
Also searched as
- find broken links command line
- wget spider broken link check
- find 404 links on website linux
- crawl website for dead links