How to fix broken links on your website (and stop new ones appearing)
Where broken links come from, how to find them, how to choose between updating, redirecting and removing each one, and how to stop them coming back.
A broken link is a link that leads nowhere useful: the page it points to has been deleted or moved, the server returns an error, or the domain no longer exists. For a visitor it's a dead end. For a search engine crawler it's a path through your site that stops, which makes it harder to discover the pages behind it.
Broken links are rarely a single dramatic failure. They build up as pages are renamed, products are discontinued and other websites reorganize. This guide covers how to find them, how to decide what to do with each one, and how to stop new ones from appearing.
What counts as a broken link
- 404 Not Found or 410 Gone: the page doesn't exist at that address. This is the most common case.
- 5xx server errors: the page exists but the server fails to deliver it, permanently or intermittently.
- No response at all: the domain has expired, DNS fails, or the request times out.
- Soft 404s: the page says "not found" but the server returns
200 OK, so tools and search engines may treat it as a real page. - Placeholder links:
href="#"orjavascript:void(0)on something that looks like a link to a page. Technically nothing breaks, but the visitor goes nowhere. - Broken resources: images, scripts or stylesheets that return 404. They aren't links, but they have the same causes and break pages just as visibly.
Why links break
- A page was deleted, or its URL slug was changed, and nobody added a redirect.
- A redesign or CMS migration changed the URL structure, such as adding
/blog/to every post or dropping.html. - Someone typed a link by hand and made a mistake.
- A relative link like
../pricingstopped working after the page containing it moved. - Links to a staging or local development address, such as
staging.example.com, made it into published content. - An external site removed or moved the page you linked to. This "link rot" is outside your control, so it needs regular checking.
How to find broken links
No single source shows everything, so combine a few:
- Check your key pages with a link checker. Rudra's free broken link checker opens a page in a real browser, collects the links that point to other pages on the same site, and requests up to 12 of them, flagging any that return an error status or no response. It also reports JavaScript errors and console errors on the page, which often come from broken scripts or files.
- Crawl the whole site. A single-page check won't find a broken link three clicks deep. Rudra's site crawl, which you can start from the demo page, follows internal links across the pages it crawls, records the status code of each link target and reports broken internal links site-wide, along with placeholder
#links. The free plan crawls up to 10 pages per scan. - Look at Google Search Console. The Page indexing report lists URLs Google tried to crawl that returned "Not found (404)". Some of these come from links on other websites, which a crawl of your own site can't see.
- Check your analytics or server logs. Views of your 404 page, with the referring page, tell you which broken links real visitors are actually following.
200 OK and still be wrong, for example a product link that now redirects to the homepage. Some sites also block automated requests and answer checkers with 403 or 429 even though the page works in a browser. Open flagged external links yourself before "fixing" them.How to fix broken links, step by step
Start by grouping the broken links by their target URL. One deleted page often accounts for dozens of broken links, and fixing the target once is quicker than editing every link. Then choose one of four fixes for each target.
1. Update the link
If the content still exists at a new address and you control the page containing the link, edit the link to point straight to the new URL. This is the best fix for internal links. Don't rely on redirects for links on your own site: each redirect adds a round trip, and links that point directly at the final URL are clearer for crawlers.
2. Add a permanent redirect
If the old URL has links from other websites, bookmarks or search results, redirect it permanently to the closest equivalent page. A few ways to do that:
- Apache (
.htaccessor the virtual host):Redirect 301 /old-pricing /pricing - nginx:
location = /old-pricing { return 301 /pricing; } - Next.js (
next.config.js):async redirects() { return [{ source: '/old-pricing', destination: '/pricing', permanent: true }]; }. Withpermanent: true, Next.js sends a 308, the permanent equivalent that preserves the request method. - Netlify-style redirects file (
_redirects):/old-pricing /pricing 301 - WordPress: a redirect plugin, or your host's redirect settings, if you can't edit server configuration.
Redirect to a page that genuinely replaces the old one. Sending every dead URL to the homepage confuses visitors, and Google may treat irrelevant redirects like that as soft 404s anyway.
3. Replace or remove the link
For external links that have died, search the other site for the new location of the page. If it's gone, link to another reliable source that covers the same point, or remove the link and adjust the sentence so it still reads well. The Internet Archive's Wayback Machine can show you what the original page said, which helps you find a replacement.
4. Let it return 404 or 410 on purpose
If content is gone for good and nothing replaces it, a 404 (or 410, which says "gone permanently") is the correct answer. Remove your own links to it, and make sure your 404 page helps people continue: a search box and links to your main sections work well.
Then tidy up
- Fix broken resources the same way: correct the path to the image, script or stylesheet, or remove the reference.
- Shorten redirect chains. If
/aredirects to/b, which redirects to/c, point both/aand your links straight at/c. Rudra's SEO checker flags a long redirect chain on the URL you test. - Re-check. Run the checker again to confirm the fixes, and re-crawl after larger clean-ups.
Make sure missing pages actually return 404
A friendly "page not found" message isn't enough if the server returns 200 OK with it. Check the status code in your browser's developer tools (Network tab, then reload), or from a terminal with curl -I https://example.com/this-page-does-not-exist. If it says 200, fix it in your server or framework; in the Next.js App Router, for example, calling notFound() renders the not-found page with a 404 status.
How to stop new broken links appearing
- Plan redirects before you change URLs. During a redesign or migration, keep a spreadsheet mapping every old URL to its new one, and put the redirects live at launch.
- Don't change slugs for cosmetic reasons. A URL that works is worth more than a slightly tidier one.
- Use your CMS's internal link picker instead of pasting URLs, so links update when pages move.
- Keep URLs consistent: lowercase, and one trailing-slash convention, enforced with redirects.
- Schedule checks. Monthly suits most sites, plus after every release or content migration.
Common mistakes
- Redirecting every broken URL to the homepage.
- Using a temporary 302 redirect for a move that is actually permanent.
- Leaving internal links pointing at redirects instead of the final URL.
- Deleting a page that other sites link to without redirecting it.
- "Fixing" external links that were only flagged because the other site blocks automated checkers.
- Ignoring placeholder
#links because they don't show up as errors.
Check your whole site for broken links
Enter your URL and Rudra crawls your pages, reporting broken internal links alongside SEO, performance and accessibility issues.
Frequently asked questions
Do broken links hurt SEO?
Google says 404 errors are a normal part of the web and don't, on their own, harm how the rest of your site ranks. The real costs are frustrated visitors, crawl paths that dead-end, and the lost value of links from other sites that point at deleted pages. Fix broken internal links, and redirect deleted pages that have external links.
What's the difference between a 404 and a 410?
A 404 means the page wasn't found; a 410 means it has been removed deliberately and won't return. Both tell search engines to drop the URL over time. Use whichever your platform makes easy; the important part is not returning 200 for a missing page.
Should I redirect every broken URL?
No. Redirect URLs that have a genuine replacement and some value, such as links from other sites, bookmarks or search traffic. Let the rest return 404, and remove your own links to them.
How often should I check for broken links?
Monthly is a good default for most sites, plus after any redesign, migration or large content change. Sites that link out heavily, such as resource directories, benefit from more frequent checks because external pages disappear without warning.
Does Rudra's broken link checker check external links?
No. It checks links that point to other pages on the same site, up to 12 per check, and the site crawl checks internal links across the pages it crawls. Check important outbound links separately, and verify any flagged link in a browser before changing it.