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. ellen says:

      I’m trying to download 1.7 and when I click on the link, it says that it’s downloading but I can’t find it on my computer. Is there a way of accessing version 1.7 directly from my WP plug-ins page?

    2. Jānis Elsts says:

      No, there’s no way to install an older version from inside WP.

      Try this: right-click the download link and choose “Save Linked Content As…” from the pop-up menu (the exact phrasing may differ depending on your browser).

    3. Nico says:

      Thank you for this plugin. 🙂

    4. […] empfiehlt sich aus SEO-Gesichtspunkten ganz und gar nicht. Sehr nützlich ist daher das Plugin Broken Link Checker, das einem diese Arbeit automatisch abnimmt und per Dashboard und E-Mails informiert, sobald es […]

    5. I installed this plugin on all my sites. I love it and it was working great. Suddenly I’m now seeing a full page of pink error message telling me Broken Link Checker installation failed. Try deactivating and then reactivating the plugin.

      When I deactivate and reactivate it appears to have fixed it but the error comes back. Do you have any knowledge of this issue? It could be a conflict with another plug-in. But before I start exploring the many possibilities I thought I’d ask if you know of any conflicts or causes.

      Thank you.

    6. Jacky says:

      I’m also getting this and have deactivated it for the time being.

    7. Tom Dolan says:

      I’ve had this plugin for several years and suddenly I’m having exactly the same issues as Sheila Hoffman in comments above mine. I haven’t added anything new for quite awhile and it has been ok till now…ideas?

      Thanx.

    8. Jānis Elsts says:

      Everyone who’s still getting an error, please try installing this version:
      http://w-shadow.com/files/broken-link-checker-debug3.zip

      If that doesn’t fix the problem, please send me the full error message.

    9. […] Broken Link Checker – čím dlhšie stránku vlastníte, tým viac je možné, že niektoré staršie linky už nebudú fungovať – stránka je premiestnená, neexistuje, alebo sa jednoducho len niečo blbé vyskytlo. Plugin kontroluje zlé linky, vedúce z vášho webu. Nemusíte sa teda obávať, že by bol čitateľ presmerovaný na 404 stránku, čo by mohlo vyznieť pre vás dosť nepríjemne, hoci za to nemôžete. Jednoducho link len “odliknete” a je to. […]

    10. Paul Mamelka says:

      Installed “debug3″, didn’t help. Message text follows:

      Broken Link Checker installation failed. Try deactivating and then reactivating the plugin.
      installation_complete = 0
      installation_flag_cleared_on = 0
      installation_flag_set_on = 0

      Installation log follows :
      Plugin activated at 2013-05-14 14:51:01.
      Installation/update begins.
      Upgrading the database…
      [OK] CREATE TABLE IF NOT EXISTS `wp_blc_filters` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `name` varchar(100) NOT NULL, `params` text NOT NULL, PRIMARY KEY (`id`) ) DEFAULT CHARACTER SET utf8
      [OK] CREATE TABLE IF NOT EXISTS `wp_blc_instances` ( `instance_id` int(10) unsigned NOT NULL AUTO_INCREMENT, `link_id` int(10) unsigned NOT NULL, `container_id` int(10) unsigned NOT NULL, `container_type` varchar(40) NOT NULL DEFAULT ‘post’, `link_text` varchar(250) NOT NULL DEFAULT ”, `parser_type` varchar(40) NOT NULL DEFAULT ‘link’, `container_field` varchar(250) NOT NULL DEFAULT ”, `link_context` varchar(250) NOT NULL DEFAULT ”, `raw_url` text NOT NULL, PRIMARY KEY (`instance_id`), KEY `link_id` (`link_id`), KEY `source_id` (`container_type`, `container_id`), KEY `parser_type` (`parser_type`) ) DEFAULT CHARACTER SET utf8
      [OK] CREATE TABLE IF NOT EXISTS `wp_blc_links` ( `link_id` int(20) unsigned NOT NULL AUTO_INCREMENT, `url` text CHARACTER SET latin1 COLLATE latin1_general_cs NOT NULL, `first_failure` datetime NOT NULL DEFAULT ‘0000-00-00 00:00:00’, `last_check` datetime NOT NULL DEFAULT ‘0000-00-00 00:00:00’, `last_success` datetime NOT NULL DEFAULT ‘0000-00-00 00:00:00’, `last_check_attempt` datetime NOT NULL DEFAULT ‘0000-00-00 00:00:00’, `check_count` int(4) unsigned NOT NULL DEFAULT ‘0’, `final_url` text CHARACTER SET latin1 COLLATE latin1_general_cs NOT NULL, `redirect_count` smallint(5) unsigned NOT NULL DEFAULT ‘0’, `log` text NOT NULL, `http_code` smallint(6) NOT NULL DEFAULT ‘0’, `status_code` varchar(100) DEFAULT ”, `status_text` varchar(250) DEFAULT ”, `request_duration` float NOT NULL DEFAULT ‘0’, `timeout` tinyint(1) unsigned NOT NULL DEFAULT ‘0’, `broken` tinyint(1) NOT NULL DEFAULT ‘0’, `may_recheck` tinyint(1) NOT NULL DEFAULT ‘1’, `being_checked` tinyint(1) NOT NULL DEFAULT ‘0’, `result_hash` varchar(200) NOT NULL DEFAULT ”, `false_positive` tinyint(1) NOT NULL DEFAULT ‘0’, `dismissed` tinyint(1) NOT NULL DEFAULT ‘0’, PRIMARY KEY (`link_id`), KEY `url` (`url`(150)), KEY `final_url` (`final_url`(150)), KEY `http_code` (`http_code`), KEY `broken` (`broken`) ) DEFAULT CHARACTER SET utf8
      [OK] CREATE TABLE IF NOT EXISTS `wp_blc_synch` ( `container_id` int(20) unsigned NOT NULL, `container_type` varchar(40) NOT NULL, `synched` tinyint(3) unsigned NOT NULL, `last_synch` datetime NOT NULL DEFAULT ‘0000-00-00 00:00:00’, PRIMARY KEY (`container_type`,`container_id`), KEY `synched` (`synched`) ) DEFAULT CHARACTER SET utf8
      Database schema updated.
      Database successfully upgraded.
      Cleaning up the database…
      … Deleting invalid container records
      … 0 synch records deleted
      … Deleting invalid link instances
      … 0 instances deleted
      … 0 more instances deleted
      … Deleting orphaned links
      … 0 links deleted
      Notifying modules…
      … Updating module cache
      … Notifying module “http”
      … Notifying module “link”
      …… Parser “link” is marking relevant items as unsynched
      …… Executing query: UPDATE wp_blc_synch SET synched = 0 WHERE (container_type = ‘page’ AND last_synch >= ‘1969-12-31 18:00:00’) OR (container_type = ‘post’ AND last_synch >= ‘1969-12-31 18:00:00’) OR (container_type = ‘comment’ AND last_synch >= ‘1969-12-31 18:00:00’)
      …… 0 rows affected
      … Notifying module “image”
      …… Parser “image” is marking relevant items as unsynched
      …… Executing query: UPDATE wp_blc_synch SET synched = 0 WHERE (container_type = ‘page’ AND last_synch >= ‘1969-12-31 18:00:00’) OR (container_type = ‘post’ AND last_synch >= ‘1969-12-31 18:00:00’) OR (container_type = ‘comment’ AND last_synch >= ‘1969-12-31 18:00:00’)
      …… 0 rows affected
      … Notifying module “metadata”
      …… Parser “metadata” is marking relevant items as unsynched
      …… Executing query: UPDATE wp_blc_synch SET synched = 0 WHERE (container_type = ‘custom_field’ AND last_synch >= ‘1969-12-31 18:00:00’)
      …… 0 rows affected
      … Notifying module “url_field”
      …… Parser “url_field” is marking relevant items as unsynched
      …… Executing query: UPDATE wp_blc_synch SET synched = 0 WHERE (container_type = ‘comment’ AND last_synch >= ‘1969-12-31 18:00:00’)
      …… 0 rows affected
      … Notifying module “comment”
      …… Deleting synch. records for removed comments
      …… 0 rows affected
      …… Creating synch. records for new comments
      …… 57 rows affected
      … Notifying module “post”
      …… Deleting synch records for removed posts
      …… 0 rows deleted
      …… Marking changed posts as unsynched
      …… 0 rows updated
      …… Creating synch records for new posts
      …… 473 rows inserted
      … Notifying module “page”
      …… Skipping “page” resyncyh since all post types were already synched.
      … Notifying module “dummy”
      Updating server load limit settings…
      Optimizing the database…
      Completing installation…
      Configuration saved.
      Installation/update completed at 2013-05-14 14:51:02 with 27 queries executed.

    11. Mike says:

      Exactly the same for me as several above.

      In addition, I deactivated and deleted 1.7.1, then installed 1.7 and the problem still occurred.

      Thanks.

    12. MichaelBoots says:

      My 1.7 has started doing it now.

    13. Jeff Jones says:

      I’ve had the same thing happen to one of my sites but not all of them. The only thing I know that’s been upgraded recently is JetPack by WordPress. I’ve also had problems with login lockdown on this site and the site is over 5 years old so it may have some irrelevant plugins that have been replaced by the WordPress functionality still active.

      Anybody else using login lockdown?

    14. Jeff Jones says:

      I backed up to 1.7 and I’ll keep checking throughout the day to see if it’s fixed. Not liking what I’ve seen so far.

    15. Tom Dolan says:

      It’s a great plugin but unfortunately I’ve had to deactivate for now. I hope there’s a solution in the future. Thanx for your work.

    16. Thanks all. Glad it’s not just me. I was out of town since my post and haven’t yet tried the fix though it doesn’t sound fruitful. I have this installed on 30+ sites. Some have Jetpack and some don’t. All use Limit Login Attempts which was fairly recently installed. As I have time I’ll look for patterns. But the error screen is so imposing and scary to clients I’ll probably have to disable until there’s a known fix.

    17. ellen says:

      I installed ‘debug3’ yesterday and, so far, it’s working on both of my sites. Yipee!

    18. Tom Dolan says:

      I’m not an experienced code-writer and having invested too much into this new site design I figured that a deactivated plugin is a potential problem that could possibly be exploited by wordpress hackers. With that in mind, this morning I removed the plugin. I really have felt secure with it for several years and will follow your future updates.

      Thanx for your efforts.

      Tom in Tokyo

    19. ellen says:

      Well, again I spoke too soon. Debug3 is not working either. I’m deactivating until I get word of a fix.

    20. Mike says:

      More info, although only echoing what others have said:

      Problem has occurred across several sites, on two different servers.

      I can’t think of any new plugins added just prior to the problem on any of those sites. Certainly at least one of the affected sites has absolutely not had any new plugins. Plugin updates are applied as they become available.

      I’ve deactivated for now.

    Leave a Reply