How to Fix Broken Links on Your Website
A broken link points to a page that does not exist or cannot be reached. Google uses links to discover pages and understand them, so broken and uncrawlable links waste that value and frustrate readers. This guide covers finding broken links, deciding the right fix for each, and writing links Google can follow.
- Find broken links
- Choose the fix
- Crawlable link format
- Prevent new ones
<a href="/page/">anchor</a> ok <span onclick=...> not ok
Crawl your site to list links returning 404 or errors, then for each one: update the link to a working URL, redirect the old URL if a close replacement exists, or remove the link if there is none. Make sure links use standard a elements with an href, because Google generally follows only those. Every page you care about should be linked from at least one other page.
Why broken links matter
Google uses links to judge how relevant a page is and to discover new pages to crawl. A link to a missing page gives readers a dead end and gives crawlers nothing to follow (the second part is my own reasoning). See fix 404 errors.
What a crawlable link looks like
| Format | Google’s guidance |
|---|---|
| a element with href | Recommended; absolute, root-relative or relative paths all work |
| onclick or class attributes | Do not prevent crawling when href is present |
| JavaScript-inserted anchors | Crawlable with standard anchor markup |
| span with href, routerLink, onclick-only | Not recommended; Google may still try to parse |
| javascript: pseudo-URLs | Discouraged |
<a href="/fix-404-errors/">fix 404 errors</a>
The href must resolve to a real web address that crawlers can request. Check JavaScript-built links with URL Inspection and JavaScript SEO basics.
Find broken links
Choose the fix
| Situation | Fix (my own guidance) |
|---|---|
| Typo in the link | Correct the URL |
| Page moved | Update link and add a permanent redirect |
| Page removed, close replacement | Redirect to the replacement |
| Page removed, none | Remove the link; let the URL return 404 or 410 |
| External page gone | Replace or remove the link |
See 301 vs 302 and redirect chains. Avoid redirecting everything to the home page; it can look like a soft 404 (guide).
Write good anchor text
- Be descriptive and concise; avoid click here and read more.
- Test the anchor in isolation: it should make sense alone.
- Do not stuff keywords; Google says that violates its spam policies.
- Empty links give no signal; image links use the alt text.
- Link every page you care about from at least one other page.
See anchor text and internal linking.
Fix broken links step by step
Crawl the site
Export 4xx and 5xx links.
Sort by source page
Fix important pages first.
Pick the fix
Update, redirect or remove.
Apply changes
Edit links or add redirects.
Recrawl
Confirm 200 responses.
Repeat monthly
Links break over time.
External links
Google says linking to other sites, such as citing sources, can build trust, and nofollow is for sources you do not trust, not for every external link. Paid links should be marked sponsored or nofollow, and user-generated links ugc or nofollow. See nofollow, sponsored and UGC links.
Notes for WordPress sites
- Slug changes: editing a slug breaks old links; add a redirect (guide).
- Deleted posts: check internal links before trashing a post.
- Page builders: buttons built with onclick need a real href.
- Plugins: broken link plugins can slow a site; a periodic crawl is lighter (my own view).
Troubleshooting
| Symptom | Likely cause (my own diagnosis) | Action |
|---|---|---|
| Link works for users but not crawled | No href | Use a standard anchor |
| 404s after redesign | URL structure changed | Redirect old URLs |
| External 404s | Source removed | Replace or remove |
| Soft 404 after mass redirect | Irrelevant targets | Redirect to relevant pages |
Checklist
Format
- a with href
- Real URLs
- No javascript: links
- Descriptive anchors
Audit
- Crawl for 4xx
- Check Search Console
- Review external links
- Note sources
Fix
- Correct typos
- Redirect moved pages
- Remove dead links
- Avoid home redirects
Maintain
- Monthly crawl
- Redirect on slug change
- Link new pages
- No orphan pages
What Google’s page does not say
The crawlable links page gives no limit on the number of links per page, no numeric weighting of anchor text or links, no crawl frequency details, and no rendering or indexing details for JavaScript beyond recommending URL Inspection. The audit tools and fix decisions here are my own practice.
Key terms
- Broken link
- Link to an unreachable page.
- Anchor text
- Visible text of a link.
- Orphan page
- Page with no internal links.
- Redirect
- Sends a URL to another.
Common mistakes
Buttons without href
Not crawlable.
Redirecting all to home
Looks like soft 404.
Generic anchors
Little signal.
Ignoring external links
Rot over time.
Changing slugs freely
Creates 404s.
One-time audit
Links keep breaking.
Related guides
Broken link questions
Do broken links hurt SEO?
They waste discovery and frustrate users; Google gives no penalty rule on the page I used.
What links does Google follow?
Generally a elements with an href attribute.
Can onclick links work?
Not reliably; Google may still try but it is not recommended.
Should I redirect or remove?
Redirect when a close replacement exists, otherwise remove the link.
How often should I check?
Monthly is a sensible routine (my own suggestion).
Do image links count?
Google uses the alt text as anchor text.
Is there a link limit per page?
Google gives no ideal number.
Should external links be nofollow?
Only for sources you do not trust, paid or user-generated links.
Link format, anchor text and internal and external link guidance come from Google’s page. Finding methods, fix decisions, WordPress notes and checklists are my own.