Broken Link Checker for WordPress

Notice: This plugin has been transferred to ManageWP. I am no longer working on it. Please direct any feedback to the new developer. See the plugin homepage for more information.

Sometimes, links get broken. A page is deleted, a subdirectory forgotten, a site moved to a different domain. Most likely many of your blog posts contain links. It is almost inevitable that over time some of them will lead to a “404 Not Found” error page. Obviously you don’t want your readers to be annoyed by clicking a link that leads nowhere. You can check the links yourself but that might be quite a task if you have a lot of posts. You could use your webserver’s stats but that only works for local links.

So I’ve made a plugin for WordPress that will check your posts (and pages), looking for broken links, and let you know if any are found.

Features

  • Detects links that don’t work, missing images, deleted YouTube videos and other problems.
  • Periodically checks links in posts, pages, comments, custom fields and the blogroll.
  • New and modified entries are checked ASAP.
  • Notifies you on the Dashboard if any problems are found.
  • Lets you edit all instances of a specific link at once.
  • Gives you a list of all links ever posted on your site, with the ability to search and filter it.
  • Lets you apply custom CSS styles to broken and removed links.
  • Highly configurable.

The broken links show up in the Tools -> Broken Links tab along. If any invalid URLs are found a notification will also show up on the Dashboard widget. To save screen real-estate, the widget can be configured to stay closed most of the time and automatically expand when broken links are detected.

Download

broken-link-checker.zip (412 KB)

    Requirements

    • WordPress 3.0 or later
    • MySQL 4.1 or later

    The current version of this plugin is only compatible with WordPress 3.0 and up. If you have an older version of WP, try one of the older releases. Specifically, version 0.8.1 is the last one that’s still compatible with the WP 2.8 branch, and version 0.4.14 is the last one compatible with WP 2.1 – 2.6.x.

    Installation

    Install “Broken Link Checker” just like any other WordPress plugin :

    1. Download the .zip file (see below).
    2. Unzip.
    3. Upload the broken-link-checker folder to you /wp-content/plugins directory.
    4. Activate the plugin in the Plugins tab.
    Related posts :

    2,584 Responses to “Broken Link Checker for WordPress”

    1. […] Broken Link Checker- Broken link checker is another great plugin when it comes to the background maintenance of your blog. This plugin is pretty self- explanatory, it checks for links within your blog posts that are broken. This is great because once you get so many posts, it can be hard to keep up with all of your links- especially those affiliate links that are supposed to be bringing in money for your blog. If something happens and these links no longer work, the plugin lets you know! […]

    2. […] Broken Link Checker: This is a tool that checks your site for broken links due to misspelling, typos or if they link to pages that no longer exist. […]

    3. Heather says:

      Greetings,

      I love your plugin. I just migrated from a linux serverto the godaddy self managed wordpress and even though you are showing compatibility for this with the most current version of WP, they have barred it from download and/or use.

      Is there a work-around? Do you know why they did this? The other one they recommend is not up to date nor is it worth a crap. It is like it sits there and makes up possible links and then never redirects where you have assigned it to go.

      Thanks!

      Frustrated in Phoenix

    4. Jānis Elsts says:

      This is probably not a compatibility issue. From what I’ve heard, GoDaddy may have restricted access to the plugin due to the server load it can cause by constantly monitoring lots of links.

      I’m afraid I don’t know any good workarounds. Perhaps renaming the plugin directory to something other than “broken-link-checker” would help?

    5. Mark says:

      Hi
      I downloaded your checker but it seems almost everything shows up as a broken link, even though it is not broken. I get that sometimes there might be a glitch, but I have literally gone through 300+ links to mark them as not broken as they weren’t. Even now, I have just done some new posts and the 3 links I included were flagged, yet they worked. If literally EVERYTHING is going to continue to show up there’s really no point, but I’m guessing there’s something amiss? Any ideas what could be going wrong please? Thanks, Mark

    6. Jānis Elsts says:

      Are all of those links to the same site, or different sites? One relatively common thing that can cause lots of false positives is that some hosting providers block loopback connections. That is, they don’t let scripts running on your server connect back to that server. This usually causes all internal links to show up broken while external links (i.e. links to other sites) are reported correctly.

    7. Kevin says:

      I am not able to activate the plug-in because it times out and returns an error saying it took took long to complete. I have around 4,000 posts/pages on the blog with many links. Is there something I can try?

    8. Jānis Elsts says:

      Unfortunately, probably not. The way the plugin currently works, it will try to set up database records for all posts/pages the moment it is activated. If the server isn’t fast enough to do that within ~5 minutes (or 30-60 seconds on servers with fixed execution time limits), plugin activation may fail.

    9. Kevin says:

      The activation is timing out after 2 minutes.

      I see that it created 246,366 rows in the wp_blc_synch table (none in the other tables). Looking at the container_type column I see:

      comment: 242,502
      page: 115
      post: 3749

      Is there any way I can exclude comments from this plug-in. I would never want to deal with bad links in comments.

    10. Jānis Elsts says:

      Once the plugin is active, you can go to “Settings -> Link Checker -> Look For Links In” and turn off the option to check links in comments. The only way to do that before activating the plugin would be to edit its source code.

    11. Kevin says:

      That works. I went into \includes\activation.php and inserted the line:

      $moduleManager->deactivate(‘comment’);

      right before //Prepare the database

      It activated in 13 seconds.

    12. Kay says:

      Hi there.

      Broken Link Checker is an excellent plugin that is helping me to reconstruct a blog that I’ve had to move 8 times in the past year…. it spots the missing images etc. and helps me restore the site.

      However, I think there is a bug. I use CALAMEO document hosting for both links and embeds. Broken Link Checker keeps telling me my CALAMEO links are broken — but they are not. I’ve just again received notice of several “broken” links that are CALAMEO embeds… and on going to my site, they are fine! This is the 2nd or 3rd notice this week on the same links! Here’s one of the notices:

      Link text : Vatican II – revolution tranquille – main tendue vers communisme
      Link URL : http://www.calameo.com/books/0007474474f9abd6d0b59
      Source : The Second Vatican Council: A Quiet Revolution in the Church

      On my “Source” page: http://www.1867confederation.net/2014/09/12/the-second-vatican-council-a-quiet-revolution-in-the-church/

      the CALAMEO embed is perfect. I’ve just started to PDF my pages online as a record of the fact I’ve fixed all broken links and images at a certain date, to try to track when, why and how they are happening.

      I wonder what it is about CALAMEO links and embeds that gives Broken Link Checker the false impression that these are broken or non-functioning.

      Thanks for your time.

      Kind regards.

    13. Jānis Elsts says:

      What status message does the plugin display for those links – the usual “404 Not Found” or something else? Is the status always the same, or does it vary from link to link? Do the notices go away on their own after a while, or are they permanent?

    14. Kay says:

      I have a number of web sites to manage and some in development. My time is limited. I therefore deliberately began to use CALAMEO to embed PDF’s of PAGES I link, instead of the PAGES themselves, so that the LINKS would NEVER BREAK! I would never have to FIX broken links.

      I only installed Broken Link Checker on the present site because I had moved it so often, that pictures were missing…. now that it’s installed, it’s HARASSING ME on a daily basis alleging all my CALAMEO links and embeds are “broken” when they are not. In the dashboard, it shows all CALAMEO links as “403” errors.

      BLC refuses to accept “Not Broken” notices. It refuses to accept “Dismiss” notices.

      I’ve got fewer than 28 so-called “broken” links to sift through now to see what other IMAGES are missing, and then I am UNINSTALLING this harassing plugin.

      Sorry, but Goodbye.

      [Alliance of the Founding Peoples of Canada] Broken links detected
      Broken Link Checker has detected 11 new broken links on your site.

      Here’s a list of the first 5 broken links:
      Link text : Read this publication at Calaméo
      Link URL : http://en.calameo.com/read/000111790c05d3f82b670
      Source : Anti-White Race Politics and Mass Immigration for World Government

      Link text : Political Ad In a French-language Montreal magazine promoting “diversity”: “Imagine A New World”
      Link URL : http://www.calameo.com/books/0007474476510683320c2
      Source : “Imagine A New World”: (But not the one Samuel de Champlain had in Mind)

      Link text : View the ad at Calaméo
      Link URL : http://en.calameo.com/read/0007474476510683320c2
      Source : “Imagine A New World”: (But not the one Samuel de Champlain had in Mind)

      Link text : Six Deputés Ecoliers De Montréal Nord Accueillis à l’Assemblée Nationale Par Rita De Santis
      Link URL : http://www.calameo.com/books/000747447c606d1fa1576
      Source : “Imagine A New World”: (But not the one Samuel de Champlain had in Mind)

      Link text : Read the publication at Calaméo
      Link URL : http://en.calameo.com/read/000747447c606d1fa1576/
      Source : “Imagine A New World”: (But not the one Samuel de Champlain had in Mind)

      You can see all broken links here:
      http://www.1867confederation.net/wp-admin/tools.php?page=view-broken-links
      Quick reply

      WEB SITE: http://www.1867confederation.net/wp-admin/tools.php?page=view-broken-links

      http://www.1867confederation.net/2015/04/07/imagine-a-new-world-but-not-the-one-samuel-de-champlain-had-in-mind/

    15. Jānis Elsts says:

      Well, that’s certainly a valid choice.

      Other options include:

      – Add “calameo.com” to the exception list under Settings -> Link Checker -> Which Links To Check. This would prevent the plugin from ever reporting those links again (though it may take a few hours for the existing reports to disappear).

      – Turn off email notifications.

      – Figure out why Calameo is blocking HTTP requests sent by BLC. If I had to guess, it’s probably because your site has a lot of Calameo links so BLC sends a relatively high number of requests to calameo.com to check those links. To some kind of automated anti-intrusion/anti-piracy system that might look like suspicious automated traffic, so calameo.com might decide to block those requests and return “403 Forbidden”.

    16. Mark says:

      Hi Janis,

      I’m getting a warning about a URL in a comment.

      If I click ‘Edit URL’ and copy the offending link, then paste it into my address bar, the site shows up almost instantly. But when I ask BLC to ‘recheck’ the URL, it times out.

      The plugin says the site isn’t there, but the site clearly is there. Any idea why that’s happening?

    17. Jānis Elsts says:

      Without knowing anything about the link, the server that hosts the linked page, its network environment, as well as your server and network, all I can do is speculate wildly.

      So the link times out when the plugin tries to access it, but works fine when you open it yourself. Consider that the plugin probably runs on a different machine (i.e. your server, not your PC) that’s in a different network and perhaps even in a different state or country. Maybe the server’s connection to that particular link/site is slow. Maybe DNS lookups are timing out due to incorrect IPv6 configuration. Maybe the linked site is blocking the plugin because some automatic anti-crawler system has noticed that it has sent multiple similar HTTP requests while checking the link(s). Maybe your server’s network happens to be under heavy load and outgoing requests take longer than usual.

      To summarize: how could one possibly know?

    18. […] Broken Link Checker, by Janis Elsts […]

    19. Andrey says:

      Hi!
      Today the BrokenLink Checker was updated to v.1.10.5 (I don’t remember what was previous version, unfortunately). There is some problem with code page, I think. The page with wrong links looks like this: http://gyazo.com/b440df46bc54ec0751f6a81c06d196de
      It’s a WordPress in russian, version 4.1.1

    20. Jānis Elsts says:

      That’s unexpected. This update didn’t have any page encoding changes, and it definitely didn’t change the Russian translation.

      As a test, I changed the language of a local site to Russian. Everything looks fine:
      http://w-shadow.com/files/blc-ru-translation.png

      Perhaps you could try downgrading to 1.10.4? You can find old versions of the plugin here:
      https://wordpress.org/plugins/broken-link-checker/developers/

    Leave a Reply