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. We’ve been able to fix many bad links in the resources lists on our site. But there are four links that it keeps marking as bad links that are really good links. Why are these URLs being marked as bad? (I tried putting them in normally but your comment form thinks it is spam so I’ll try the following to see if that gets accepted.)

      www dot accessible dot ie
      www dot accessible dot ie/?p=50
      www dot natural-access dot com
      www dot eschoolnews dot com

      Thanks.

    2. White Shadow says:

      @SleeplessinDC – Those links work fine in my tests. Anyway, the next version of the plugin will have more detailed reporting which should help you figure out why the links get marked as broken.

    3. […] of link checkers on the internet, but for all you WordPress-ers, there’s an easier way – the broken link checker plugin. I recently installed and ran it on one of the sites I look after, and it came up with a list of […]

    4. CID says:

      Hi there,

      I thought I’d give BLC a try in WP 2.6(.1). No (PHP/WP) errors but it marks perfectly fine links as ‘broken’ while they’re obviously not! At first I thought it only did that with ‘shorthand’ links like domain dot com instead of www dot domain dot com but it has now also marked other ‘good’ links as ‘broken’…

      This somewhat negates the use of BLC…

      However: Great plugin and I’m looking forward to seeing any issues resolved or more documentation on ‘why BLC marks those links as broken’ becomes available.

      Thanx!!!

    5. White Shadow says:

      @CID – If you have the latest version (0.4.8) you should be able to get some clues as to why those links were marked as broken by clicking the new “Details” button(s) in Manage -> Broken Links. However, meaningful info will only be available about “broken” links that were checked with this newer version.

    6. CID says:

      Hey WhiteShadow,

      Thanks for your quick response!
      Yes, I do have version 0.4.8 and it lists ‘details’. However, every link detail (except the URL’s and time ofcourse) reads:

      ——————————————————————————
      Last checked : 2008-09-09 12:06:09
      Final URL : http://www.cid-iv.com
      HTTP code : 0
      Log :
      === First try : No response. ===

      Trying a second time with different settings…
      === Second try : No response. ===

      Link is broken.
      ——————————————————————————

      The sites load fine but BLC keeps getting ‘no response’…

    7. White Shadow says:

      @CID – It’s probably timing out. The timeout is hardcoded to be about 30 seconds (when using CURL). Maybe I should add an option to configure it…

    8. CID says:

      Yes, well, that would, in any case, be a welcome addition. Always nice to be able to set the threshold for this kind of functionality. But I don’t think that that’s the case here because the site (mentioned in the example) loads in under 2 seconds… (Checked with Fasterfox.)

    9. White Shadow says:

      @CID – Maybe the site has some kind of security software in place to prevent suspicious bots from accessing it. Wouldn’t be the first time.

    10. CID says:

      Ok, yes, that would cause such behaviour, I will check!
      But how about the internal links it marks as ‘broken’?
      And to me it seams that it has problems handling shorthand URL’s. Or can’t that be the case?

    11. White Shadow says:

      @CID – “shorthand” URLs shouldn’t be a problem if the URL is otherwise valid and working. In particular, external links should always include the protocol part (usually http://).

      Are the local links using relative URLs? The plugin should handle it, but the algorithm is not perfect.

    12. Bart Gibby says:

      ~ bug ~
      When I activate the plug-in my website bleeds through the admin. So I can actually see my website below with some themes the admin, and integrated with the admin in other themes.
      ~ end bug ~

      has this been fixed yet?

    13. Bart Gibby says:

      When I search for “broken link checker” in the wordpress plugins search I do not see your plugin any more. What happened?

      http://wordpress.org/extend/plugins/search.php?q=broken+link+checker

    14. White Shadow says:

      @Bart Gibby – The WordPress.org plugin search is notoriously bad. The plugin page is still up.

      As for the “bug”, check that wsblc_ajax.php is present in the plugin’s folder (i.e. in wp-content/plugins/broken-link-checker/) and that it doesn’t have any weird permissions set. Actually, just see if you can access yourblog.com/wp-content/plugins/broken-link-checker/wsblc_ajax.php. You might have a .htaccess rule or some security module blocking it. Or possibly your “wp-content” folder isn’t where the plugin expects it to be.

    15. cartmanffc says:

      Broken Link Checker is not compatible with Ozh Better Feed

    16. White Shadow says:

      @cartmanffc – Okay, thanks for the info.

    17. Stefan says:

      If i’am klick on ‘unlink’ in the list of Broken Links, The complete text of the Artikel is deleted!

      I’am working with the newest Version of WordPress 2.6.2!

    18. White Shadow says:

      @Stefan – Err, sorry? That has never happened in my tests :/ If you have backups (hopefully you do) could you mail me the post (including HTML etc, not just the text) that got deleted? My email is whiteshadow (et) w-shadow (dott) com
      I would run some tests with that posts and try to find the cause of the problem.

    19. alice says:

      Love the plugin — it works so much better than any other link checker I’ve tried! Sadly, I had to turn it off after upgrading WP because of server load problems (I’ll keep an eye out for updates that address this issue!).

    20. White Shadow says:

      @alice – Thanks 🙂
      I haven’t been able to pinpoint the source of the performance issues yet as only certain people/blogs seem to have them. The plugin has always been running well on my sites.

    Leave a Reply