קישורים שבורים באתר: איך מוצאים אותם ומתקנים לפי הסדר
SEO

Broken Links on Your Website: How to Find and Fix Them

Broken links are links that lead to a page that no longer exists, so the visitor who clicks gets an error page instead of the content you promised. Dealing with them is simple. You find them through Search Console and a crawl of your site, then fix each one at the source, meaning you update the link itself, and only when you have no choice do you add a redirect.

Not every 404 error is a problem. The Search Console Help Center states that a 404 for a page that was removed with no replacement is not necessarily a problem. The problem starts when a link on your own site, in a menu, a button or inside an article, keeps leading to the dead page. That is where the visitor gets stuck, and Google’s crawler wastes a visit on an empty address.

In this guide I went through the checks in the order I would run them on a WordPress site, how to recognize each type of broken link and exactly what to fix in each case.

Why broken links hurt visitors and crawling

According to Google’s documentation on links, it uses links both to find new pages to crawl and as a signal of how relevant pages are. It also writes that it can only crawl a link that is an <a> element with an href attribute. So your internal links are the map Google follows inside your site.

When a URL returns a 4xx code, Google does not index it, and a page that was already indexed and starts returning 4xx drops out of the index. According to the same documentation, 4xx codes (except 429) do not affect the crawl rate of the site. So a single 404 does not “punish” the site, but an internal link that leads to it sends both the visitor and the crawler into a dead end, and if the original page was ranking, it falls out of the results. This is only one of the reasons your website is not making progress on Google, and if this check does not solve it on its own, I wrote a checklist that goes through six more checks in order.

From the visitor’s side it is even simpler. Someone who clicked “more details” and got an error page will not always try again. So fixing broken links is first of all a service to your visitors, and crawling benefits along the way. It is also one of the common reasons for a low dwell time on a website, and I wrote a separate article on how to find and fix the cause of that.

First check: the page indexing report in Search Console

The first place to look is Search Console, in the Pages report (page indexing). In the list of reasons for pages that were not indexed you will find the row Not found (404). According to Google’s help, Google can discover such a URL through links, or because the page used to exist.

For each URL on the list it is worth running a URL Inspection. Under Discovery you will see the Referring page, a page Google may have used to discover the URL. The wording matters here. Google notes that the referring page may link directly, but it may also be several steps away from it, so it is a good hint about where to look and not final proof.

In the same report you will sometimes also find Soft 404. That is a page that shows the visitor a “not found” message or an empty page, but returns a success code to the server. Google’s recommendation for a page that truly does not exist is to return a 404 code. I covered this case in the article on Soft 404 in Search Console.

Second check: crawl the whole site

Search Console shows what Google found, but it does not always show every broken link on your site, and it does not tell you where on the page they sit. So the next step is to crawl the site yourself with a crawler. Software like that goes through all the pages, clicks every link and returns a list of broken links together with the page where each one appears.

When you have the list, sort it into two types:

  • Internal links that lead to pages on your own site that return a 404. These matter most, because they are entirely in your control.
  • Outbound links to other sites where the page was deleted or moved. These are less urgent, but they still send the visitor to an error page.

Pay special attention to links that repeat on every page, such as the main menu, the footer, a sidebar or a fixed button. One broken link in an Elementor template or a widget appears on every page of the site, and one fix solves them all. In an online store the problem is bigger, because every deleted product leaves dead URLs behind in categories and wish lists. If you run a store, I wrote a separate guide on how to promote an online store that goes through the right order of checks and fixes.

The first cause to check: you changed a URL or deleted a page

The first place to look for the source of the problem is something you did yourself on the site: changing the ending of a page URL (the slug), deleting a product or an article, or changing the permalink structure under Permalinks. The links that pointed to the old URL stay where they are, inside articles and menus.

WordPress handles part of this on its own. The function wp_old_slug_redirect(), which has existed since version 2.1.0, tries to find the current URL of a post by its old slug when a 404 is received. It helps, but I would not trust it as a solution. The mechanism is based on a post’s saved slug, and it does not cover a deleted page or a changed structure. So the right check is to open the old URL in the browser and see what comes back.

If you recently moved servers or domains, a move like that can break many links at once. I wrote a separate article on it, moving a WordPress site without breaking it.

How to fix: the link first, a redirect second

Every broken link has three options, and it is worth going through them in this order:

  1. Update the link at the source. If the page exists at a new URL, go into the page that contains the link and replace the address with the correct one. This is the cleanest solution, because the visitor goes straight to the destination with no jump on the way. Google also recommends, after changing URLs, updating as many links as possible to the new URLs.
  2. Add a permanent redirect (301). When a new page replaces the old one, and links to it exist outside your site that you cannot update, add a 301 redirect from the old URL to the new one. According to Google, a permanent redirect is used as a signal that the target URL is the canonical one, and it recommends keeping such redirects for at least a year, and preferably as long as possible.
  3. Remove the link and leave the 404. If the page was deleted and has no real replacement, delete the link or replace it with a link to another relevant page. Google states explicitly that a 404 for a page removed with no replacement is not necessarily a problem.

There is one thing I do not recommend, which is redirecting every dead URL to the homepage. The visitor is looking for specific content and lands on a general page, which is not much different from an error page. A redirect should lead to a page that truly replaces the old one.

And if along the way you create a redirect that points to another redirect that returns to the first, you get a loop. I wrote about that in the article on ERR_TOO_MANY_REDIRECTS in WordPress.

Broken links that come from other sites

There are also broken links that are not on your site at all, when another site linked to a page of yours at a URL that no longer exists. You cannot edit the link itself, so here a redirect is the right tool. If a new page replaces the old one, a 301 redirect from the old URL to the new one will send visitors who arrive from there to the right place.

In URL Inspection you will see a Referring page only for what Google found, so you will not always know exactly where the link comes from. That is why it is worth starting with the URLs that appear under Not found (404) and that used to be important pages on your site, such as products or service pages.

After the fix: check that it really worked

A fix that was not checked is a guess. After you update links and add redirects, go through these checks:

  • Open each old URL in the browser, in a private window, and confirm it reaches the right page.
  • Clear the site cache, and the CDN cache if you have one, so visitors do not get an old version of the page with the old link.
  • Run Test live URL in URL Inspection on a page you fixed. According to Google, the live test is meant for exactly this case, checking whether a problem was fixed.
  • After you fix all instances of the same error in the Pages report, click Validate Fix. Google writes that validation usually takes up to two weeks, and that you will get updates by email.
  • Run the site crawl again and check that the list of broken links has really shrunk.

To keep the problem from coming back, check again after every big change, such as deleting products, changing a menu, a redesign or a server move. Each of them changes URLs or deletes pages.

When to stop and call an expert

You can do most of the work on broken links yourself, and updating a link in an article or a menu takes minutes. But there are a few situations where it is better to stop:

  • The list is very long, and most of the URLs broke at once after a server move, a domain change or a permalink structure change. Here you need an organized map of old and new URLs, and redirects written on the server.
  • You added a redirect and the site went into a loop, or some pages suddenly do not open.
  • The redirects need to be written in the .htaccess file or in the server settings, and you are not sure what you are doing. One mistake there can take down the whole site.
  • Important pages, such as products you sell or service pages, dropped out of the index and you do not understand why.

Before any change like that, take a backup of the site. And while you are working on the links on your site, it is worth also going through your internal links and making sure every important page receives links from other pages.

If you prefer that someone go through your site, find the broken links and fix them without breaking anything else along the way, you can contact me here.

Frequently asked questions

Do broken links hurt rankings on Google?

Google writes that 4xx codes (except 429) do not affect the crawl rate, and that a 404 for a page removed with no replacement is not necessarily a problem. What does happen: a page that returns a 404 drops out of the index, and a broken internal link sends visitors and crawlers to an empty address instead of a page that could have ranked.

How do I find broken links on a WordPress site?

Start with the Pages report in Search Console, under Not found (404), and check each URL in URL Inspection to see the Referring page. Then crawl the whole site with a crawler that returns every broken link together with the page where it appears.

Which is better, fixing the link or adding a 301 redirect?

If the link is on your own site, it is better to update it to the correct address. A 301 redirect fits when a page replaces the old one and links to it exist that you cannot edit, for example from other sites.

How long should I keep a 301 redirect?

Google recommends keeping redirects for at least a year, and notes that from the visitors’ point of view it is better to keep them as long as possible.

What is the difference between a 404 and a Soft 404?

With a 404, the server announces that the page does not exist. With a Soft 404, the page looks like an error page or an empty page, but the server returns a success code. Google recommends returning a 404 for pages that truly do not exist.

Does WordPress redirect on its own when you change a URL?

In some cases, yes. The function wp_old_slug_redirect tries to find a post by its previous slug when a 404 is received. It does not cover a deleted page or a change in link structure, so it is always worth checking the old URL in the browser.

Have a project worth talking about?

The call is free, with no commitment 😊