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

      hello thanks for this plugin has come along way since i first sen it one thing if you can tell me where in the code i can change the timeout value as some of the sites i use/link to can load slow at times therefor they be reported as broken links

      thanks

    2. White Shadow says:

      @Allstar : Looks like this is a bug in the linked site and possibly cURL. The the example URL returns a misnamed field in the HTTP response header (“location” instead of “Location”) and apparently this causes some kind of glitch in your version of cURL.

      Well at least that’s what I think. Here’s a test : put a link to http://w-shadow.com/redirect302.php in one of your posts (this is simply a one-line PHP script that does a well-formed 302 redirect to my homepage. You can use an old post and remove the link later). If my idea above was right, this link should be detected correctly by the plugin.

      @ paul : The timeouts are set in the link-classes.php file.

      If you have cURL, change the lines 159-160 :

      curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 20); //connection timeout (in seconds)
      curl_setopt($ch, CURLOPT_TIMEOUT, 30); //overall timeout (in seconds)
      

      If not, change line 222 :

      $snoopy->read_timeout = 60; //read timeout (in seconds)
      
    3. I have a longstanding blog with many broken links.
      Finding them is one thing … do you have a global search and replace utility that works on my WordPress SQL database to fix any that I condsider fixable ?

    4. White Shadow says:

      You can change a link via the plugin’s interface. On the broken link list, hover your mouse over the link’s URL and click the “Edit” thing that will show up. Then input the new URL and click “Save”. This will replace the old URL with the new one in all posts and pages where it’s used.

      Also, check out the Search and Replace plugin.

    5. Wow, many thanks.
      That’s the power I am looking for … I shall be trying out this plug in and contributing if it works 🙂

    6. Double wow – that global S&R will be very useful too … I have repeatedly mistyped names and terms over the years and that will ease my housekeeping.

    7. […] Broken link checker: Este plugin revisa os links externos do nosso blog e comprova que estes links estão ativos ainda ou não. Muito útil para artigos antigos. […]

    8. Jacob Share says:

      When I activate the plugin on a test blog with only a few articles (v0.5.3), it works like a charm. When I activate it on my main blog with over 300 articles and thousands of links, it takes a few minutes to get going and the site isn’t responsive during that time.

      Any way to improve performance and making the install/upgrade play more nicely in the background?

    9. […] engorro tratar de localizarlos uno a uno y ver por qué están fallando. Sin embargo, con el plugin Broken Link Checker for WordPress (que ya tiene un par de años, pero desconocía), esta labor es coser y cantar. El programa sondea […]

    10. White Shadow says:

      @ Jacob : Sorry, I can’t think of anything useful at the moment. Maybe your server is just slow? It might be possible to make introduce some kind of staggered update algorithm, but that wouldn’t make much sense for the initial install because most users probably want the plugin to be up and going as fast as possible.

    11. Gabriella says:

      Hi! The plugin is nice, but I decided to delete it from one of my blogs because the plugin does uses too many memory and the uninstall process simply brought me to a blank page, and nothing was deleted 🙁
      At first look, it seems that you are using the right code, but who knows. I’m using WP 2.8.1.
      Any fix necessary?

    12. White Shadow says:

      I’m not sure what I can do about the memory usage, but I’ll fix the uninstaller right away (found the bug).

    13. […] Broken Link Checker for WordPress: muy completo. Rastreo programable. Opciones avanzadas como la de cambiar el estilo de los enlaces rotos, por ejemplo tachándolos. […]

    14. White Shadow, thank you for your time.

      Can you think of reasons why I seem to be getting a lot of false broken links? I think this has been going on since upgrading WP to 2.8 (now at 2.8.2 and latest plugin). They show up as broken links, but when I expand them they show something similar to:

      # Link last checked : July 20, 2009
      # HTTP code : 0
      # Response time : 0.000 seconds
      # Final URL :
      # Redirect count : 0
      # Instance count : 1

      What other info would you need? Thank you for your time.

    15. White Shadow says:

      Links that are currently being checked may be incorrectly reported as broken. However, those false positives should go away in a few minutes, tops.

      Another possibility is that the plugin starts checking a link (the link record is “half-updated” immediately due to complicated reasons) and the link URL takes a long time to respond, causing the checking script to be terminated for exceeding the maximum allowed execution time. I’ve never seen this happen myself, but it’s theoretically possible on servers that have the max execution time set low and don’t allow scripts to change it.

      Or it could just be a legitimate link timeout. Network glitches/server overloads do happen. In this case the false positives should go away in a few hours.

      If you don’t think the above ideas explain the issue, post a few example URLs that are (consistently and incorrectly) detected as broken. I’ll see if I can find out why.

    16. […] Broken Link Checker – monitors and notifies you for broken links on your blog. […]

    17. […] Broken Link Checker is really handy.  It goes through your site and looks for broken links – then displays a nice dashboard widget telling you how many unique links you have in your site, and how many of them don’t work.  Since the web is everchanging, a site that is up today may be gone tomorrow – it’s handy to know so that you can easily remove broken links without having to test them all yourself. […]

    18. […] de buscar durante varios días enlaces rotos en el blog a través de sus cuatro años de existencia he observado mi reflejo en cada palabra como […]

    19. Larry says:

      Just like Dan I’m getting 12 false broken links on a regular basis. When I recheck all pages the list clears, but then later the same 12 show up again. Here are three.

      http://www.resourcesystemsconsulting.com/blog/wp-content/uploads/John D_ C_ Little.gif

      http://www.resourcesystemsconsulting.com/blog/wp-content/uploads/Mentors Guide.jpg

      http://www.resourcesystemsconsulting.com/blog/wp-content/uploads/warehouse 2.jpg

    20. […] with by the webmaster to inform visitors that the links are not working. The Broken Link Checker plugin is an excellent way of finding and removing broken links from a WordPress […]

    Leave a Reply