Fix Broken Links in WordPress: Find, Redirect, Prevent
To fix broken links in WordPress, start with the free “Not found (404)” report in Google Search Console, then crawl your own pages to find links that point at missing URLs. Edit internal links so they point straight at the right page, use a 301 redirect when a page has moved, and let a page return 404 or 410 when it is gone for good. A short check each month stops them piling up again.
There are three different problems hiding under “broken links”, and each has its own fix:
- Your pages link to a URL on your own site that no longer exists. Usually after a page was renamed, deleted or moved. Fix the link itself.
- Your pages link to another website that has moved or closed. Update the link to the new address, or remove it.
- Other people, or Google, still ask for an old URL of yours. You cannot edit their links, so you redirect the old URL, or let it return an error if there is nothing to send them to.
Step 1: Start with Search Console (free)
Google Search Console already lists the URLs on your site that Google tried to fetch and got a 404 for. Open your property, go to Indexing > Pages, scroll to “Why pages aren’t indexed” and open Not found (404). You get a list of URLs and the date Google last crawled each one.
Do not try to fix every line. This list includes URLs that never existed (typos in someone else’s link, old test pages, bots guessing at paths). Look for two things:
- URLs that used to be real pages on your site, especially ones that had traffic or that you know other sites link to.
- Patterns. If dozens of 404s share a pattern, such as an old
/blog/prefix or a category name you changed, one redirect rule or one bulk link fix solves all of them.
Click a URL and use Inspect URL to see what Google knows about it. When it lists a referring page, that tells you where the broken link lives.
If you use Rank Math, its 404 Monitor module (switched on from the Rank Math dashboard) logs the missing URLs real visitors and bots hit, which fills the gap between Google’s crawls. It writes every hit to your database, so on a busy site check it, act on it, and clear the log rather than letting it grow.
Step 2: Crawl your own pages for broken links
Search Console tells you which URLs fail. A crawler tells you which of your pages contain the broken link, so you know what to edit.
- Screaming Frog SEO Spider runs on your computer, not your server, and the free version crawls up to 500 URLs, enough for most small business sites. Crawl your home page, open the Response Codes tab, filter to Client Error (4xx), select a URL and look at the Inlinks tab at the bottom to see every page that links to it.
- Broken Link Checker is the long running WordPress plugin for this. Current versions offer a cloud scan run from the developer’s servers, plus the older local engine. The local engine checks links from your own server and can be heavy on shared hosting, so if you use it, run a scan, fix what it finds and deactivate it rather than leaving it running.
Run the crawl again after you make changes. Fixing one batch often reveals links you missed.
Step 3: Decide what each broken link needs
For every broken URL, pick one of four actions:
- Fix the link. If the broken link is on your own page, edit it to point straight at the right URL. Do this even if a redirect exists, because each redirect is an extra hop for visitors and crawlers.
- 301 redirect. If the page moved or was replaced by a page that answers the same need, send the old URL to the new one with a permanent (301) redirect. This keeps visitors arriving from old links and bookmarks, and passes the old URL’s signals to the new page.
- Let it return 404 or 410. If the page is gone and nothing replaces it, an error is the honest answer. A 410 says “gone on purpose”, a 404 says “not found”. Google’s documentation on HTTP status codes groups them together: URLs that return either are dropped from the index over time.
- Ignore it. URLs that never existed on your site (random bot paths, malformed links) need no action. A 404 is the correct response.
Avoid redirecting every missing page to the home page. It looks tidy but it confuses visitors who expected something specific, and Google can treat those redirects as soft 404s anyway. Redirect only to a page that genuinely replaces the old one.
Step 4: Set up redirects in WordPress
Use one tool for redirects, not several. Rules spread across a plugin, an .htaccess file and a host or Cloudflare rule are how redirect chains and loops happen.
- Rank Math: switch on the Redirections module in the Rank Math dashboard, then add rules under Rank Math > Redirections. You can choose a 301, 302, 307, 410 or 451 per rule, and send a 404 from the 404 Monitor straight to a redirect.
- Redirection plugin: the free Redirection plugin (under Tools > Redirection) does the same job and has its own 404 log.
- Yoast: the redirect manager is part of Yoast SEO Premium, not the free plugin.
WordPress itself remembers a post’s old slug when you change it and redirects the old address to the new one. That is handy for a small rename, but do not rely on it for bigger moves such as changing your permalink structure, moving content between post types or changing domain. Add proper redirects for those.
After adding redirects, clear your page cache and test the old URLs in a private browser window. Check that each one lands on the right page in a single hop.
Step 5: Bulk fix links after a URL change, with WP-CLI
When a section of your site moves, or you change domain, the old URL is written into hundreds of posts. Editing them one by one is slow and easy to get wrong. If your host gives you SSH access with WP-CLI, wp search-replace updates every occurrence in the database, including inside serialised data that plugins and page builders store.
Always take a database backup first and do a dry run:
wp db export before-search-replace.sql
wp search-replace 'https://example.com.au/old-section/' 'https://example.com.au/new-section/' --skip-columns=guid --dry-run
The dry run shows how many replacements each table would get without changing anything. If the numbers look right, run the same command without --dry-run, then clear every cache. Use the full URL, not a short fragment like /old/, which can match text you did not mean to change. If your site uses a page builder, check a few edited pages afterwards. Keep the redirect from Step 4 in place as well, because links on other websites still point at the old address.
If you have no SSH access, ask your host or developer to run it. Do not run search and replace plugins on a live store without a backup you have tested.
A monthly routine that stops them piling up
- Open Search Console’s Not found (404) report and look only at new entries since last month.
- Check your redirect tool’s 404 log for URLs that get repeated hits.
- Crawl the site with Screaming Frog (or your link checker) and fix any 4xx links on your own pages.
- Before you delete or rename a page, decide where its URL should go and add the redirect at the same time.
- Note what you changed, so the next person knows why a redirect exists.
If you would rather not do this yourself, our WordPress care plans include monthly link and 404 checks done for you, along with updates, backups and monitoring. Broken internal links are also a symptom of a weak linking plan, which our guide to internal linking for WordPress sites covers.
Frequently asked questions
Do broken links hurt my Google rankings?
A 404 on a URL that should not exist is normal and expected. The real cost is elsewhere: visitors who hit a dead end leave, and a page that used to rank or attract links loses that value if it is deleted without a redirect. Fix broken links on your own pages and redirect old URLs that mattered.
Should I use a 301 or a 410 for a deleted page?
Use a 301 if another page genuinely replaces it. If nothing replaces it, a 410 or a plain 404 is correct. Google treats both as a signal to drop the URL from its index over time.
Is the Broken Link Checker plugin safe to leave running?
The cloud scan option does the checking off your server. The local engine checks links from your own server, which can slow a site on shared hosting. If you use the local engine, run it, fix the results, and deactivate it until the next check.
How often should I check for broken links?
Once a month suits most small business sites. Check straight away after a redesign, a permalink change, a domain move or deleting a batch of pages, because that is when most broken links appear.
Be the first to comment