How to Find and Fix broken links in WordPress – Part 2

Posted on Mar 15, 2011

In my previous article, “Part 1: How to Find and Fix broken links in WordPress” I talked about how you can find broken links within your site. To summarize, I suggested you look at Google Webmaster Tools, visit http://www.2bone.com/links/linkchecker.shtml or install the ‘Broken Link Checker’ WordPress plugin.

Now, I will teach you how you can fix your broken links.

  • A major cause of broken links is a mistyped URL. Perhaps you missed the “http” out or misspelled the domain name. This happens frequently with images. Just edit the URL within the link HTML and you are good to go. Below are two examples of how the code for a basic link should look. Compare this to the code of your broken link.

1. Text Link: I will link the anchor text – “WordPress Expert” to http://YourWordPressExpert.com/

<a href="http://YourWordPressExpert.com/"> WordPress Expert </a>

2. Image Link:

I will link the logo below to http://inntaonlinesolutions.com/wordpress- theme-customization-services/

Standard Theme Pic2 - Affordable and Quality WordPress Websites

<a href="http://inntaonlinesolutions.com/wordpress-theme-customization-
services/"><img src="http://inntaonlinesolutions.com/wp-content/uploads/
/2010/07/Starter-Theme-Pic1.png"></a>
  • If you don’t feel confident editing the HTML and you are using a platform like WordPress, you might want to try deleting the link and adding it again using the visual editor. Just make sure that you know the real URL of the page you are linking to. To be certain you are getting it 100% correct, it is best to open up the web page you want to link to. Then do a copy to capture the URL rather just typing the address from memory. With some web browsers (e.g. Google Chrome), you can’t see the full URL in the address bar with your eyes, but when you copy it, you get the whole address.
  • When you move your pages or change the URLs, it is best to implement redirects if you are not able to update the hyperlinks pointing to these pages, individually. A redirect means that when a link is accessed; the user will be sent (redirected) to a different page. The redirect will happen so quickly, that the user will unlikely even notice it. There are a few different ways to do a redirect, but one simple way in WordPress is to use the “Pages Links to” plugin. With this plugin installed simply go to the old page and type in the URL of the new page in the ‘page links to’ section. I will be discussing other approaches to redirects in upcoming articles.
  • Not all links can be fixed, so the best option maybe to delete it. This is generally the case when you have no control over the page being linked too. For example, suppose you embed a video from YouTube and the owner removes the video. You have no choice but to delete the embedded code. If you still like a video, perhaps, you could find another video to embed, replace the old, broken code with the new code from the alternative video.

Prevention is better than cure, so you really need to check your website for broken links constantly. The plugin I mentioned to you last time, the “broken link checker” will help you keep an eye on it. Also, for times when broken links do occur make sure you optimize your 404 error page so that search engine spiders and your visitors don’t reach a road block.

Related posts:

  1. How to find and fix broken links in WordPress – Part 1

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word