How to Find and Fix Broken Links on Your Website
What is a broken link?
A broken or dead link is a link that does not take you to a valid page and instead takes you to a 404 not found page.
You can frequently come across such links on the web. For example, you are browsing through an old article on your favorite news website and click on a link inside the content.
The link takes you to a page that says the post you are looking for was not found and you must instead try searching.
You feel disappointed since you were curious about knowing more on the topic. However, you stop browsing there or return to the previous webpage. Links can break due to a variety of reasons but they have a significant effect on user experience as we have already explained above.
Fixing such dead links on a regular basis is important since if we do not, a large number of such links will accumulate on our website and hurt user experience, SEO and crawlability.
What causes broken links?
Links can break or become dead due to many reasons. For example, you linked to an external domain inside a post and some months later, that website removed the page you had linked to or the domain itself stopped working. So, the urls to that website, you had inserted into your content will break and stop working.
In another case, you have been following a url structure on your website but a few years later decided to change and adopt a different structure. Suppose, you had been following a url structure that included the category slug, and you later decided to remove the category part. Your entire url structure for your website has changed.
Once you have changed the permalinks structure, unless you replace all the existing links with new ones, a large number of links on your website will break. This will lead to a poor user experience but also cause other issues.
In another scenario, you deleted some posts on your blog. However, these posts were linked to from other blog posts. Now, if visitors land on those pages and click on the broken links, they will be taken to a 404 page, which can be disappointing for users.
Links can also break if you remove or change certain categories or tags from your website. Any posts or pages that have been linking to those categories, will experience an increase in broken links.
If you decide to change your domain name and adopt a new one, you will need to redirect all existing links on the old domain to the new domain to avoid experiencing heavy growth in broken links and loss of SEO juice.
Broken links hurt UX and SEO
Why should someone bother about the broken links on his website unless they have any negative impact? Well, the answer is that broken links can have a negative impact on SEO, crawlability and user experience.
In terms of SEO, too many broken links reflect that the site is not well maintained which has a poor impact on website reputation. When Google crawls your site and comes across the broken links that lead nowhere, it gives rise to a 404 not found error.
Interlinking in internal pages is a good practice in terms of SEO. When you interlink internal pages, one page passes on page authority to another. However, it is not the case with dead links since dead links do not receive any authority which gets wasted.
In terms of user experience, dead links cause a poor user experience since visitors landing frequently on dead ends are more likely to stop browsing and leave the site. For an improved browsing experience, there must not be any dead links. When visitors come across dead links and leave the website, it will increase your bounce rate.
So, you can see that broken links have a negative impact in terms of crawlability since Google will be crawling dead links that it must not be crawling, when it must be crawling the more useful pages on your website. It hurts SEO and user experience also. Therefore, it is recommended to fix the broken links on your website.
How to find and fix broken links on your website?
There are several tools that can help you find the broken links on your blog/website and you can fix them by editing the posts and pages or using a search and replace.
Use an Online Broken Link Checker
The best tool for finding broken links on your website is the online broken link checker. Just go to brokenlinkcheck.com. Enter your website url and let the tool scan your website posts and pages for broken links. This free online tool crawls and checks 3000 posts for free. Blogs or websites with 3000 or less pages will find this tool very useful.
Run the check and check the box to report only one instance of each broken link. If the number of broken links reported after the scan is low, you can rerun the scan to report each instance of every broken link.
This tool is easy to use and works very fast. Your report that will include both internal broken links and external broken links will be available within minutes. You can check out the broken links and the source pages where these links were found. The tool also highlights where the broken links are in the html of the source page.
Use the Google Search Console
While the Google Search Console only reports 1000 urls only, you will still find it very useful to find broken links on your website.
You can find out the broken links from the indexation coverage report. Go to ‘Pages’ inside the Google Search Console.
Now, check out the links that Google has reported as 404 not found. If the number of such links is less than 1000, then this report must be sufficient to help you find and fix broken links on your website.
Open the 404 not found error report and then select a url. Click on Inspect the url. The inspection report will show you if there are any referring sitemaps on your website and the page where Google search bot found the broken url. This referring page can be a page on your own website or another domain. If it is a link from another domain, you can try to get it fixed by contacting the webmaster or using a redirect. If it is a broken link from your own website, copy the referring page and remove or fix the broken link.
Inspect 404 urls in GSC
Use Broken Link Checker plugin to find and fix broken links
This option is for Wordpress users only who can use the plugin created by WPMU DEV for finding and fixing broken links.
The plugin is free to use, so you do not need to pay anything. You can install and activate it from the Wordpress plugin repository like you install any other plugin.
You will see two options for link checking. One is the local method which is very slow and might not work in all conditions. We recommend you to use the other method - Cloud method. Click on cloud and you will be taken to the WPMU DEV dashboard for signup and login. You will need to provide your WP admin and password or you can use the WPMU DEV dashboard plugin for this functionality.
Once your site is connected to the WPMU DEV dashboard, you can click on run the scan inside your WPMU DEV account. The broken link checker will start scanning your website for links and it is going to take a while.
The plugin crawls all the links on your website which means there would be thousands of links to crawl even if your blog has just 1000 posts. However, this is good for your website since a deep crawling will ensure that no broken link is left. Once the crawling is over, you can check the report inside the WPMU DEV dashboard. The report will include the broken links and the source urls where the plugin found those links. You can check out the source pages and remove or fix the broken links.
How to fix broken links on your website?
Once you have found the broken links on your website, it is time to fix them.
Edit the links
Now that you have found the broken links on your website, you must be thinking what to do with them. Several links can be broken because they have a type or because there was a change in the url format. For example, you had been using a permalink structure that also included the category slug. Later you switched to a different format.
Now the old links are causing 404 errors since they have become dead. You can edit these links if they are few in number and replace them with the correct links. If there is a typo or a wrong link, you can edit and fix it also.
Redirect Broken Links
If there are a large number of similar links that have become dead due to a change in url structure or change in category name, you must redirect these urls to the right url. For example, you renamed a category on your website and the urls that included the old category name became dead. So, you can use a .htaccess redirect to redirect these urls to the new category urls. Something like this:
RedirectMatch 301 /old-category/(.*) /new-category/$1
In this way, you can redirect your visitors to the right pages and reduce the number of 404 errors on your website. Users will not come across a dead end but will be redirected to the right pages when they click on the old urls.
Remove links
If there are many such broken links that cannot be redirected to any relevant content, you can just remove them. Once Google stops finding such links on your website or from external resources, it will drop them from its list.
For example, you might have deleted many posts or pages from your website but forgot to remove their links from the other pages linking to them. Now you discover that these urls had been linked to from many of your other posts.
If you have suitable content to which you can redirect your users and which can replace the content you have deleted, redirect the users to the new content or remove the urls for deleted posts and pages. Any such broken url that cannot be edited or redirected should be removed since keeping such urls will harm SEO and UX.
Do a search and replace
Wordpress users have another great option to deal with broken urls. They can carry out a ‘search and replace’ to remove broken urls and replace them with new ones. For example, you changed a category name leading to a change in category slug and now there are several such broken links that you might need to redirect. Instead of using only a redirect, you can use a redirect which will help users coming from external sources find the right urls and a ‘search and replace’ replace old urls with new ones.
For example, you can replace https://example.com/category-old/some-url/ with https://example.com/category-new/some-url/.
Otherwise, you can replace only the string https://example.com/category-old/ with https://example.com/category-new/, which will replace all the instance of old urls with new urls at once.
To make such replacements, you can use the Better Search Replace Plugin in the Wordpress repository. Carry out a dry run first to know how many urls will be replaced and then carry out a final search-replace. Do not forget to take a database backup before making any changes.
If you are tech savvy and do not want to use the plugin, you can instead carry out the ‘search-replace’ using the WP-CLI or Wordpress Command Line Interface.
A few last words:
Broken links are not good for your website’s health. An abundance of broken links on your websites will mean that you do not keep your website well maintained, which will hurt your website reputation and rankings.
The higher the number of dead links on your website, the higher the number of 404s you encounter in the Google Search Console.
It also means wasted link juice and negative effect on crawlability. It will also mean crawl wastage since the Google bot will repeatedly hit a dead end. While 404s do not necessarily hurt SEO, fixing them can offer some advantages in terms of both SEO and user experience.
Too many broken links are a sign of a poorly maintained website. So, regularly audit your website using an online tool, a plugin or using Google Search Console data and fix dead links.