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. dave l says:

      just curious, is “broken link” checker Broken? it seems as if every day I have to upgrade it to a newer version? I do not always check my plugins every day. will this be a problem for this plugin.?

    2. White Shadow says:

      @ dave l : The core functionality is pretty stable. Most of the updates consist small improvements suggested by users (e.g. using Esc/Enter in the “Edit URL” box, localized date display, and so on) and fixes for rare bugs (e.g. redirect detection failing when the server has a buggy version of cURL). You will not lose much if you don’t install the update(s) immediately.

      Personally, I think periodic updates is a good thing. They show the plugin is up-to-date and actively supported.

      @ Henrik : Yes, that’s been suggested before. I guess I’ll have to move it closer to the top of my to-do list.

    3. Rudi says:

      Thanks for creating this plugin.

      This plugin make my work more easy….

      CAN I REQUEST A NEW FEATURES?
      Can you add some features for check and fix broken link on comment page?
      Thanks before

    4. Guide Delini says:

      Thanks a lot for your plugin.
      I have two requests:
      1 – I use the PODS plugin which allows to add custom pages : is it possible to check links in PODS? or in other page…
      2 – When using the broken link checker, the referrer is set to the domain name; is it possible to set the referrer to the page where the link is found? Otherwise, the external site may think it is spam referrer. Moreover, if the referrer is set with the page where the link is, you may win some links back. Good for SEO.
      But again, great plugin!

    5. […] a lot of development, and some features definitively need improvement, but it’s very useful. Broken Link Checker for WordPress | W-Shadow.com VN:F [1.7.6_1010]Rating: 0.0/10 (0 votes […]

    6. White Shadow says:

      @ Rudi : Yes, it’s on my to-do list 😉

      @ Guide Delini : I’ll take a look at PODS, but no guarantees. Using the post URL as the referrer might be doable, but it would further increase the plugin’s resource usage (if only slightly).

    7. […] Installed the Broken Link Checker on all of my sites. Now, I will automatically know if any links are […]

    8. Asmodiel says:

      Hi there!

      As i stated before, the plugin has problems with the temp dir on open_basedir affected systems. I like your idea of the error catching (about line 2790, core.php) but it only works when i first check the ini_get(‘upload_tmp_dir’), because the other one throws the same error because you aren’t even allowed to check whether a folder is writable when it’s outside the open_basedir.

      So you just have to change the order of the two if()s.

      Thanks,
      Asmodiel

    9. White Shadow says:

      “Neveeer!”
      * Runs off laughing maniacally *

      But seriously, that sounds like a bug in PHP, and I’ve still got a few ideas about how to work around it. Try the latest development version.

    10. […] solch ein Unterfangen ganz erheblich erleichtern: Search & Replace von Frank Bültge und der Broken Link Checker von Janis Elsts, um mal die beiden wichtigsten zu nennen, die mir heute den Tag gerettet haben. […]

    11. FizzyPopMan says:

      Hi.

      First of all… great plugin. Thanks!

      Just to let you know, I did the automatic upgrade today and I got the “can’t create a lockfile” error message (not sure why as the directory was writable). Anyway, I uninstalled the plugin, downloaded the new version from the WordPress site, and it now works fine.

      Just thought you might want to know!

      Cheers
      Fizzy

    12. White Shadow says:

      I changed around some of the code that detects if a directory is writable, so I guess I might have introduced a new bug. Let me know if it happens again.

    13. Asmodiel says:

      Wow, you finally managed it to purge all bugs from the activation and installation on a open_basedir affected server!
      Thank you, now I don’t have to change the file manually each update 🙂

      Asmodiel

    14. SCMG says:

      Greetings…

      I have the same error as “fizzy” above:

      Broken Link Checker can’t create a lockfile. The current temporary directory is not accessible; please set a different one. Details.

      I can’t seem to get it to relinquish – I’ve completely uninstalled / removed – and reset up – to no avail… any suggestions ???

    15. White Shadow says:

      So the new “writability-detection” algorithm works on sites where it didn’t work before (e.g. Asmodiel’s) and doesn’t work on sites where it did (Fizzy & SCMG).

      I’ll modify the plugin so that it only uses the new algorithm when open_basedir is set, as in Asmodiel’s case. An update should be out soon.

    16. PK says:

      Hi, when i use the plugin it tells me: Broken Link Checker can’t create a lockfile. Even after i create a new directory, made it writable, i get the same message, what could it be? no debug info, everything is working, curl,snoopy all of that………what could it be?

    17. White Shadow says:

      Do you have the latest version (0.7.2)? If not, wait until you get the update and then try again.

    18. PK says:

      yes latest version…

    19. White Shadow says:

      Hmm, I don’t see why that would happen. What’s your lockfile location? Is open_basedir set on your server? (you can find out by going to Settings -> Link Checker and clicking “Show debug info”).

    20. PK says:

      lockfile location /public_html/wp-content/lockfiles

      open_basedir is on, i just encountered another problem, it gets stuck after checking half of the links, now it does nothing, i set max exucution time to 600 but no luck…

    Leave a Reply