How to check and fix broken links in WordPress

Almost no website is devoid of broken links, whether they are links to internal website pages themselves, or external pages to which links are sent from within the website content. This is because any page is vulnerable to modification, deletion, or a programming error occurring in it after a period of time.

Broken links often affect the user’s experience greatly. When he goes to the requested page, he finds that it directs him to the error page (404) , which gives a negative impression of accessing the requested content.

Broken links on the site also negatively affect the archiving and ranking of the site in search engines, as broken links are considered one of the famous SEO mistakes that must be fixed to avoid any unwanted effect on the part of search engines on the pages and links of your site.


How does a link go from an active link to a broken link on your site? 

There are many possibilities that cause the problem of broken links within your site, and one of the most common reasons is if you delete one of the pages or articles of your site by moving it to the trash, for example:

In this case, after you moved the page to the trash, when you access the page link, a message will appear telling you that there is a 404 error, as the page no longer exists within the site:

One of the other most common possibilities for the problem of broken links to occur is if you change the domain name of the site. For example, if you change the domain from site1.com to site2.com, all links to the entire pages and articles of the site will change according to the change in the domain name, which causes the problem of broken links to occur in large numbers. Very large within your site.

Also, permalinks may cause a broken links error when you change them from one style to another:

See the guide to changing permalinks and controlling them correctly to avoid the problem of broken links appearing on your site. Changing permalinks in WordPress is one of the procedures that requires extreme care when performing it.


Ways to discover broken links on your WordPress site

Detecting the presence of broken links within the site and working to fix them periodically and continuously is one of the beneficial measures for the health of your site and its operation in a way that does not affect the experience of visitors, as well as the confidence of search engines in the site and the proper arrangement of its pages. 

Of course, there is a manual method through which you can manually detect broken links yourself and without relying on any external add-ons, but this procedure will also be very tiring and cumbersome, as it requires a lot of time and effort from you to check all the site’s links manually, especially if it is Your site contains a large number of pages, and this manual procedure is not considered 100% accurate.

We will rely on ready-made tools and add-ons to obtain a report of broken links within the site with ease, and then we will repair those links and redirect them correctly.

1- Detect broken links using Google Console 

One of the easiest ways through which you can detect broken links on your site for free is through the Google Console webmaster tool .

You can log into your account in the tool, go to the Coverage tab, and then click on the Excluded box

After that, you will see a list of all the errors that your site suffers from, among which you will find the type of error 404, which is the error related to broken links that no longer work or are no longer valid:

When you click on the 404 error list, a complete page will open for you containing all the broken links within your site. You can click on any link from that list to confirm that it is indeed a broken link, as the 404 error page will open in front of you, informing you that this content is no longer available on the site.

2- Detect broken links using some tools

There are many tools that can provide complete reports on broken links within your site, including paid ones such as the Ahref tool, the Semrush tool, and other tools that provide a comprehensive examination of the site to issue reports on the complete health of the site, which contain a broken links report. 

Some of them are free, such as the free Broken Link Checker website , which you can access, paste your site link, and click the Find broken links Now button.

After a while, you will see a list containing the control of broken and invalid links within your site. If there are no broken links, a message will appear telling you that there are no broken links on the site:

3- Detect broken links using WordPress plugins

There are some WordPress plugins that help you create reports containing broken links within a WordPress site. 

We will explain the Link Checker add-on , which checks website links and accesses all broken links in record time, and then you can work on repairing those links using the methods that we will show you during the following paragraphs. 

After you install and activate the plugin on your site, you can access its tab from within the WordPress control panel and click on the Check your website button to begin scanning all of your site’s links to check for broken links:

Once you click on the aforementioned scan button, the add-on will begin automatically and without your intervention to perform a complete scan of all pages and links to the site. Then a report will appear before you containing broken links, where you will find within it all the links that lead to a page with the error message 404, meaning that the content It is no longer available and therefore the link is broken and inactive:

4- Fix broken links on your WordPress site 

After you learned about the multiple methods through which you can detect all broken links within your site that lead visitors to an empty error page that does not provide any useful content. 

The step comes to fixing those broken links on your site so that they are active and available for browsing, as well as being properly configured for search engines. 

The best solution to fix any broken link on your site is to redirect this link, so that the visitor is directed to another page on the site that offers similar or alternative content to the content of this broken link instead of showing the 404 error page.

You can view the WordPress link redirection guide in more than one way to learn about the different ways in which you can redirect links. 

We will also explain here the use of one of the methods that redirects broken links using the Red rection add-on , which redirects all broken website links to other active links within the site. 

The way the plugin works is easy, so you install and activate it on your site , then log into the WordPress control panel, then go to its tab (Redirection) to show you the following settings.

You will find that the extension’s general settings page contains two fields to complete the conversion process as follows:

  1. Source URL : in which the broken link or the inactive link on the site is pasted inside it
  2. Target UR: In which the new link to which the old one is to be redirected is pasted

After pasting the broken link as well as the active link inside the site and clicking the Save button within the same page, then when anyone clicks on the broken link or pastes it inside a web browser, he will be directed directly to the active link automatically.

Conclusion

In the end, constantly checking broken links is one of the periodic and continuous procedures that you must do and follow up constantly, as this problem when faced by some visitors may cause them to leave the site and may not return to it again, especially if this link contains very important information for visitors. .

We also advise you to rely on external tools that provide reports about broken links on your site instead of using WordPress plugins if possible, because plugins that scan site links may cause an increase in the site’s loading time because they consume many resources from your server.

Avatar photo
I am a young man who has been working in WordPress and e-marketing for 10 years. I would like to share my experience with you so that we can become professional in WordPress I will be happy to share the experience with you.