Sélectionner une page

How To Find And Fix Broken WordPress Links

How To Find And Fix Broken WordPress Links

A broken link is a link that directs visitors to a page or file that no longer exists. It is sometimes collectively referred to as link rot, or simply as dead links.

Most websites contain broken links. They are unavoidable. Over time, the likelihood that a page you linked to within one of your articles increases. There are a number of reasons that this could occur:

  • The website owner changed the post slug of a page (perhaps to improve SEO)
  • The website has been restructured; resulting in pages having a different URL (e.g. changing from the default WordPress structure to clean URLs)
  • The website owner has removed the page
  • The website no longer exists
  • The website has transferred to a new domain and the owner has not set up a redirect
  • The website may be offline due to hacking, a firewall, or the website owner not paying their hosting bills

The above reasons assume that a link has become broken because of a website owner changing a URL or removing the page. However, sometimes the fault lies with you, not them. It is easy to make a mistake and link to the wrong URL.

A common error is to forget to include http:// at the start of a link. When you make this mistake, browsers assume that you are trying to link to a location that is relative to your current location. For example, if I incorrectly linked to www.google.com from this article instead of http://www.google.com, the URL would be publised as https://www.elegantthemes.com/blog/www.google.com.

Why You Should Fix Broken Links on Your Website

There are many benefits to fixing the links that are broken on your website. First and foremost, you will give your visitors a better user experience. I am sure you have been reading a good article and then discovered that the links that are contained within it are all outdated. It is very frustrating. This reflects badly on the website and suggests the content is outdated and no longer relevant.

Secondly, there are SEO benefits to fixing broken links…isn’t there?

Many SEO experts say that fixing broken links, missing images, and 404 page errors, will improve your overall search engine ranking. I have found that for every person out there backing this claim up with hard evidence, there are thousands of people who state with conviction that fixing broken links will give you an SEO boost, only because they heard someone else say this. I wouldn’t be surprised if I made this claim myself several years ago because I assumed it was true.

I don’t know if it is true or not as I am not an expert on search engine optimization. Google states on their website that 404 errors will not impact a website’s ranking. This conflicts with the idea that 404 errors and broken links can hurt a website’s ranking.

“Generally, 404 errors don’t impact your site’s ranking in Google, and you can safely ignore them. Typically, they are caused by typos, misconfigurations (for example, for links that are automatically generated by a content management system) or by Google’s increased efforts to recognize and crawl links in embedded content such as JavaScript.” – Google

Even though Google has confirmed that 404 errors will not hurt a website’s rankings, they do encourage all website owners to fix links on their website. Google also has a long history of saying one thing, and doing another; so perhaps 404 errors can damage your ranking.

For me, whether 404 errors and broken links hurt search engines is a non-issue, as it is in your interests to fix links that have been broken if you want give visitors a good experience. This is a big priority if the articles that have broken links generate a lot of traffic.

“If the links are coming from your own site, fix or delete them. If they’re coming from an external site, you can use this data to help improve your site’s user experience. For example, a misspelling of a legitimate URL (www.example.com/awsome instead of www.example.com/awesome) probably happens when someone intended to link to you and simply made a typo. Instead of returning a 404, you could 301 redirect the misspelled URL to the correct URL and capture the intended traffic from that link. You can also make sure that, when users do land on a 404 page on your site, you help them find what they were looking for rather than just saying “404 Not found.” However, this is only worth the effort if the incorrect link is generating significant traffic.” – Google

There are a number of services and software applications that will scan your website and report broken links to you. Finding broken links will show you:

  • Links within your articles that are broken
  • Pages on your own page that are no longer valid

Let us take a closer look at how you can find broken links on your website.

Google Webmaster Tools is a great way of finding 404 errors and broken links. You will find this information in the Crawl Errors page; which is located in the Crawl section of the main menu.

The page displays site errors and URL errors for desktops, smartphones, and feature phones. URL errors are categorized, with server errors, soft 404 errors, and normal 404 errors (not found), all being shown separately.

Google Webmaster Tools

The Crawl Errors page highlights errors on your website.

The not found page lists all of your 404 errors. It is worthwhile going down the list and checking each error. Some errors will refer to pages that you have removed from your website, however others will be genuine broken links that need to be fixed.

Google Webmaster Tools

Google lists all of your broken links.

Clicking on the error brings up details about the broken link, such as the full URL of the broken link and the first time the error was detected.

Google Webmaster Tools

Google provides information about each broken link to help you resolve the issue.

The “Linked From” tab will help you see exactly where the broken link was found. As you can see, I found a broken link on an interview I published in 2012.

Google Webmaster Tools

The “Linked From” tab shows you the page the broken link can be found.

In the post, I should have linked to an article entitled “8 Golden Rules To Attract Twitter Traffic“. Unfortunately, I incorrectly linked to the page using <a href=”8 Golden Rules To Attract Twitter Traffic” title=”http://www.johnpaulaguiar.com/8-golden-rules-to-attract-twitter-traffic/”>8 Golden Rules To Attract Twitter Traffic</a>. As you can see, I placed the URL in the title attribute and the title in the href attribute. It is a simple mistake that can be made from time to time; but it was enough to break the link.

Fixing the code will repair the broken link and stop it from being listed as a 404 page error on Google Webmaster Tools.

W3C, aka the World Wide Web Consortium, has a link checker that checks broken links and more. Since W3C is responsible for maintaining standards for the web, their link checker is recommended by many website owners.

I am not a big fan of the way the link checker works. It is more of a pain to detect broken links and resolve the errors than other solutions available. However, there is not denying the link checker is thorough and lists all the broken links found on your website.

W3C Link Checker

W3C Link Checker will highlight broken links, redirects, valid anchors, and more.

Broken Link Checker is one of the best link checking solutions available to WordPress users. The plugin scans your whole database and displays the links that are broken; highlighting the http status code, the link text, and the post or page in which the link can be found. You can select broken links and choose to mark them as not broken, unlink the link, and rescan.

Broken Link Checker

Broken Link Checker scanes all of your posts and pages.

The great thing about the plugin is that it can scan your database regularly and then email you if it finds a broken link. It can also apply formatting to broken links so that they are easily visible to everyone.

You can choose what custom post types are scanned for links and whether posts with different statuses, such as draft or scheduled, are also scanned. The plugin can also scan for YouTube, Vimeo, DailyMotion, Google Video, and Megavideo videos, and then report to you if the video has been removed.

Broken Link Checker Options

Broken Link Checker will email you if it finds a new broken link.

Xenu’s Link Sleuth is a script available for Windows that can check links, images, stylesheets, and scripts. Once it has scanned your website, it will provide information such as the URL, page size, page title, last date it was updated, outgoing links, and incoming links. It can also detect redirected URLs.

The report that it provides can be exported as a CSV file and emailed easily due to its small size. A Google sitemap can also be created through the software.

Xenu's Link Sleuth

Xenu’s Link Sleuth is a useful script for Windows users that allows you to export the report.

Screaming Frog SEO which can crawl your website and provide a detailed report on broken links, errors, missing header tags, meta information, and more. It can also be used to create an XML sitemap for your website.

The software is available for Mac, Windows, and Linux. The free version of the script has a crawl limit of 500 URLs. The premium version removes this at a cost of $99 per year. If you are using the software for all of its SEO features, you should consider the premium version. However, there are many free broken link solutions available that don’t have a restriction of 500 URLs.

Screaming Frog SEO Spider Tool

Screaming Frog SEO is a feature packed SEO script that can check for broken links.

PowerMapper’s SortSite can help you find broken links and missing images. It can also be used to find errors with CSS, flash, RSS, scripts, and more.

PowerMapper’s link checking solution is available online or as a script that works on Mac, Windows, and tablets. They offer a free evaluation, but with only 10 pages and images provided in the report, it is way to limited to be considered a free solution. They do, however, allow you to test their service for 30 days. Their SortSite Desktop retails from $149, with their Mac and Tablet ready OnDemand Suite costing $49 per month.

PowerMapper Broken Link Checker

PowerMapper has many great features, though it is not a cheap solution

Link Valet is a basic link checking service that highlights the HTTP response codes of links on your website. It can take a while to scan your whole website, and while the color coding does help you spot broken links, there is not an easy way to see all broken links together at a glance.

Link Valet

Link Valet displays a unique color for each type of response code.

Link Checker is a website validator script that is available FREE under GPL for Windows, Mac, and Linux. It can crawl your website for broken links and provide a report that can be exported in normal text, HTML, SQL, CSV or XML. The software will also honor the rules you outline in your robots.txt file.

Link Checker

Link Checker is a great script that was released under the General Public License.

Other Broken Links Resources

Below is a list of other resources that you may want to use to find broken links on your website. They are all free to use.

Fixing Your Broken Links

Once you have created a list of broken links on your website, you can proceed to repair them. There are a few ways in which you can do this.

When the broken links are on your own website, you can do one of the following:

  • Correct the Link – If you linked to a website incorrectly, all you need to do is edit the URL and replace it with the correct value. For example, one of the most common reasons a link becomes broken is because the author forgot to put http:// at the beginning. Sometimes, correcting a link requires more investigation, such as when a page you linked to has been moved to a new location or the website has completely changed their domain.
  • Replace the Link – There are times when it makes more sense to replace a link in an article. For example, when you have referenced a resource that no longer exists, is no longer supported, or has not been updated in years. The idea is to replace the website you referenced with an alternative resource. This ensures that the article remains useful to visitors.
  • Unlink the Link – If the page you linked to no longer exists, or is no longer relevant, you may want to completely remove the link from the article. This may also mean removing any content that refers to the page you referenced.

Restructuring your website, or changing the post or page slug, can cause 404 errors on your website (not found errors). This will make your internal links to the old URL invalid. It can also reduce the traffic your website receives from other websites, therefore it is important to address the issue. The most practical way of resolving the issue is to create a 301 redirect from the old URL to the new one. This ensures that traffic, and search engine juice, is transferred to the new URL.

If you have found that another website has simply linked to one of your pages using an incorrect URL, you may want to consider contacting them and advising them of their mistake. Do not be concerned if the website owner does not comply with your request, as you can always configure a redirect to handle incoming traffic to the incorrect URL. Additionally, if you have set up a good 404 error page on your website with a search bar and links to your archives, visitors should still find the page in question.

“404s are a perfectly normal (and in many ways desirable) part of the web. You will likely never be able to control every link to your site, or resolve every 404 error listed in Webmaster Tools. Instead, check the top-ranking issues, fix those if possible, and then move on.” – Google

If you have not performed a clean up of your broken links in sometime, you may have to spend a few hours fixing issues on your website. However, after you have done so, the task of keeping the links on your website clean becomes simpler, as you only need to review your website links periodically. A solution such as the WordPress plugin Broken Link Checker makes this process straight forward as you will be emailed whenever a broken link is found.

Final Thoughts

Whether fixing broken links helps search engine rankings or not is irrelevant, as repairing broken links on your website will ensure your articles remain useful to your readers. That alone makes it worthwhile.

There are many ways to find broken links on your website. My own preference is Google Webmaster Tools or the WordPress plugin Broken Link Checker. However, some of the other solutions mentioned in this article offer a more complete picture of the problems associated with your website, such as missing header tags and problematic usability issues.

I hope you found this article on fixing broken links useful. If you know of any other great ways to find broken links on a website, please feel free to share them in the comment area below.

Article thumbnail image by HieroGraphic / shutterstock.com

Source link

Poster le commentaire

Votre adresse e-mail ne sera pas publiée.