DEV Community

SteadyUtil
SteadyUtil

Posted on

How to find broken links on a website

A broken link is a small thing until a customer, a colleague or a search engine hits it. You might notice one 404 while you browse. Finding the rest — including images, scripts and links out to other sites — takes a systematic check of the pages you already have.

This guide is for anyone who needs to find broken links on a website, whether it is your own site or a site you are allowed to audit. By the end you will know the free one-page method, what Google Search Console can (and cannot) show you, a short script for a known list of URLs, and one option when you want a whole-site crawl with a report.

We at SteadyUtil built SEO Audit Crawler.

Please crawl only sites you have a reason to check, respect robots.txt and each site's terms, and keep request rates polite. This is not legal advice; follow the rules that apply to you. If you are auditing your own site, that is the most straightforward case.

The free way: one page, then Search Console

In the browser, for the page you have open. Open Chrome (or another Chromium browser), press F12, go to the Network panel and reload. Filter by status-code:404 (or click Img to look only at images). The Console also prints “Failed to load resource” for assets the page requested. This catches missing images and scripts on this page. It does not request every page your links point to, because those are not loaded until someone clicks.

Google Search Console, for your own verified site. If the site is yours and you have Search Console set up, the Page indexing report lists URLs on your host that Googlebot could not get (including 404s). It is free and already on Google’s crawl schedule. It will not give you a complete audit of outbound links to other domains, and it only shows examples, not necessarily every affected URL.

Those two steps are the right start. They are also incomplete: they will not tell you which of your pages still link to a dead URL, and they will not check a whole tree in one pass.

A short script, for a list of URLs you already have

If you already have a list — from a sitemap, a spreadsheet, or every URL from a website sitemap — you can request each one and record the status code. A minimal example (standard library only). Check robots.txt first, pause between requests, and use this only on sites you are allowed to test:

import time
import urllib.error
import urllib.request

urls = [
    "https://books.toscrape.com/",
    "https://books.toscrape.com/catalogue/category/books/academic_40/index.html",
]
opener = urllib.request.build_opener()
opener.addheaders = [("User-Agent", "seo-audit-howto/1.0 (your-email@example.com)")]

for url in urls:
    try:
        with opener.open(url, timeout=20) as response:
            print(response.status, url)
    except urllib.error.HTTPError as error:
        print(error.code, url)
    except Exception as error:
        print(type(error).__name__, url, error)
    time.sleep(1)
Enter fullscreen mode Exit fullscreen mode

A 404 or 410 is usually a real miss. A 500 may be temporary. A 403, 429 or LinkedIn-style 999 often means the checker was blocked, not that the page is dead — confirm those in a browser before you treat them as broken.

This script does not discover new URLs by itself, and it does not tell you which page contained the link.

One Actor, when you want a whole-site audit

SEO Audit Crawler is a SteadyUtil Actor on Apify. It crawls a site the way a search engine would: it starts from a homepage (or any start page), follows internal links, and can read XML sitemaps (from robots.txt or /sitemap.xml). For each crawled URL it records status, titles, meta, headings and other on-page fields, and it checks unique links, images and scripts for errors. Each broken URL is listed with the pages that link to it and the anchor text. Links behind bot protection (403/429/999) are not reported as broken.

It also looks for duplicate titles, meta descriptions and content, canonical and hreflang mistakes, noindex and sitemap problems (including orphan pages and indexable pages missing from the sitemap), and a set of site-wide checks (soft 404s, http→https, www/non-www, robots.txt and sitemap presence). Every site gets a 0–100 health score and, by default, a shareable HTML report. The Actor documents 60+ checks per page (errors, warnings and notices).

It does not execute JavaScript. It audits the HTML the server sends, which is also what many crawlers do in their default mode — and what search engines see before rendering. That is a deliberate limitation, not a hidden one.

Open the Actor in Apify Console, or start from a ready-made example:

A typical first run (the public Books to Scrape sandbox is a safe demo host):

{
  "startUrls": [{ "url": "https://books.toscrape.com/" }],
  "maxPagesPerSite": 50,
  "useSitemaps": true,
  "checkExternalLinks": true
}
Enter fullscreen mode Exit fullscreen mode

The dataset has page rows, broken-link rows, and a site-summary row with the score and the HTML report URL (reportUrl). You can narrow the crawl with include/exclude URL patterns or a max click depth if you only want one section. It respects robots.txt and Crawl-delay by default; turn that off only for a site you control, and only if you have a reason.

import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: 'YOUR_API_TOKEN' });
const run = await client.actor('steadyutil/seo-audit-crawler').call({
    startUrls: [{ url: 'https://books.toscrape.com/' }],
    maxPagesPerSite: 50,
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
for (const row of items.filter((item) => item.type === 'broken-link')) {
    console.log(row.statusCode, row.url, 'found on', row.foundOn);
}
Enter fullscreen mode Exit fullscreen mode

Schedule a weekly Task if you want to catch new 404s after each deploy.

Use it from Claude or Cursor (MCP)

If you already use Claude, Cursor, or VS Code, you can run the same Actor as a tool, without filling in the Apify Console form.

Apify hosts an MCP server at https://mcp.apify.com. Connecting is free. When the Actor runs, the charge goes to your Apify account, at the prices in the section below ($8.00 per 1,000 pages audited, plus $0.20 per 1,000 extra link checks, with lower prices on higher Apify plans). Apify's free plan includes $5 of usage each month, and no credit card is required.

The quickest setup is to pin this Actor so it loads as its own tool. This is the configuration Apify shows on the Actor's API → MCP tab:

{
  "mcpServers": {
    "apify": {
      "type": "http",
      "url": "https://mcp.apify.com/?tools=fetch-actor-details,steadyutil/seo-audit-crawler"
    }
  }
}
Enter fullscreen mode Exit fullscreen mode
  • Cursor: paste that into your MCP settings, or run /add-plugin apify in chat and click Connect when Cursor opens the Apify sign-in page.
  • Claude Code: put it in the project's .mcp.json, then run /mcp to sign in. Or: claude mcp add apify "https://mcp.apify.com/?tools=fetch-actor-details,steadyutil/seo-audit-crawler" -t http
  • Claude.ai or Claude Desktop: add a custom connector named Apify, using that same URL. Claude Desktop does not accept a remote MCP URL in its config file. Sign in when the browser opens.
  • VS Code: use the same URL under the "servers" key (not "mcpServers"), or install the Apify plugin from the agent plugin marketplace.

On first connect, sign in to Apify in the browser (OAuth). You do not need to put an API token in the config. If your client cannot use OAuth, set an Authorization: Bearer <APIFY_TOKEN> header, with a token from API & Integrations in Apify Console.

Then ask, for example: "Audit https://books.toscrape.com/ for broken links and SEO issues. Cap the crawl at 50 pages and give me the broken-link list and the site score."

Cost is controlled with maxPagesPerSite (default 50; the allowed range is 1–20,000) and maxLinkChecksPerSite (default 200) for extra unique link, image, script and external URL checks. Start with one host and the default page cap.

You can also connect to the default server, https://mcp.apify.com, without pinning this Actor. The agent can then search Apify Store and run it. Official docs: Apify MCP server.

Pricing, plainly

Pay per event; you are not billed for Apify compute time. List prices (Free and Bronze plans):

  • $8.00 per 1,000 URLs audited ($0.008 each) — pages, redirects and error pages that were crawled.
  • $0.20 per 1,000 extra link checks ($0.0002 each) — each unique remaining internal link, resource or external URL, once per run.
  • URLs blocked by robots.txt, bot-protection challenges and network failures are not charged.
  • If you turn on Apify residential proxy, traffic is billed at $0.012 per MB. Most sites you are allowed to audit do not need it.
  • Apify also applies a small actor-start fee ($0.00005 per GB of memory used for the run, at least one event).

Higher Apify Store plans pay less automatically (for example, Gold and above list the page event at $6.40 per 1,000 and link checks at $0.16 per 1,000). A first run of 50 pages plus 200 extra link checks is at most $0.40 + $0.04 = $0.44 at the list prices, plus the start fee.

Frequently asked questions

How do I find broken links on a website for free?

Start with DevTools on a single page, and Search Console if the site is yours. For a known list of URLs, a short script that records status codes is enough. For a whole site, you need a crawler.

Does Google Search Console show all broken links?

It shows URLs on your verified host that Googlebot had trouble with, not a complete map of outbound links, and not necessarily every example. Confirm anything important yourself.

Why was a link flagged as 403 or 429, but it opens in my browser?

Many sites block automated requests. Treat 403, 429 and 999 as “check by hand,” not as automatic 404s. The Actor does not report bot-protection responses as broken links.

Does the crawler run JavaScript?

No. It reads the HTML the server sends. For a site that builds all of its content in the browser, the audit shows what is there before rendering.

Can I audit only one section of a site?

Yes. Set include/exclude URL patterns or a start URL inside that folder, and keep maxPagesPerSite modest. There is a ready-made section audit example.

Is it OK to crawl someone else’s site?

Only if you have a legitimate reason and you respect their terms and robots.txt. Prefer your own site. This is not legal advice.

If you want to keep going

If DevTools or Search Console already answered the question, stop there. If you need a site-wide broken-link list — including which page links to each 404 — SEO Audit Crawler is on the Apify Store. SteadyUtil is at steadyutil.com, and support is support@steadyutil.com.

This article is about finding broken links and related site-health issues, not about detecting which CMS or libraries a site uses. If you need a URL list first, we have a separate guide on how to get every URL from a website sitemap (and find the 404s).

SEO Audit Crawler is an independent SteadyUtil product and is not affiliated with, endorsed by, or sponsored by Google LLC.

Top comments (0)