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. Jānis Elsts says:

      @Floris:
      A “Recheck Now” item for each link would indeed be useful, but I’m somewhat reluctant add new stuff to the list of link actions in case it becomes too long and cluttered. At least for now, you could use the “Recheck” option in the “Bulk Actions” drop-down.

      There is a donation button on the plugin settings page, at Settings -> Link Checker 🙂

    2. Peter DeHaan says:

      This is a wonderful plugin and has helped me find and fix hundreds of broken and redirected links on my various websites. (My old link checker doesn’t play well with WordPress so I’ve not been able to check links since I’ve switched them to WordPress.)

      I have found some instances of broken links that aren’t caught and assume something in my configuration got in the way, but I don’t understand the options well enough to figure it out.

      More importantly, I have ongoing problems with false positives and am not sure how to deal with them. (I’ve not used the “not broken” or “dismiss” options because I don’t know the long-term ramifications if I click on them.) Sometimes, it seems that if I “unlink” and manually add the link back, the problem is solved, but it might be coincidence.

      Are there any instructions available for the configuration options and especially on how to deal with false positives?

      (Having that information will turn me from a fan into a raving fan!)

    3. Mike Gantt says:

      I have installed your Broken Link plugin but it is not detecting my broken links. I broke one intentionally and it is not even identifying that one. What might be wrong? What sort of troubleshooting can I do?

    4. Jānis Elsts says:

      @ Peter:

      I have found some instances of broken links that aren’t caught and assume something in my configuration got in the way, but I don’t understand the options well enough to figure it out.

      Could you post some example links and their reported statuses? (You can use the contact form if you don’t want to post them publicly.)

      More importantly, I have ongoing problems with false positives and am not sure how to deal with them. […] Are there any instructions available for the configuration options and especially on how to deal with false positives?

      Unfortunately, there is no general solution to false positives. There are dozens of different problems that can cause them including things like temporary downtime, misconfigured firewalls, hotlink protection scripts, exceedingly paranoid security software, sites that intentionally block all web crawlers or bots, incorrect DNS settings, PHP “safe mode” and so on.

      That said, if you could post a few examples I might be able to offer some suggestions.

      @ Mike:

      Does it report all of your links as working, or does it not show any links at all? Take a look at Tools -> Broken Links -> All – it should list all links detected on your site including working ones.

      If the “All” section is empty, chances are the default load limit setting is too low for your server. Go to Settings -> Link Checker -> Advanced and change “Server load limit” to something slightly larger than the “Current load” number.

    5. Mike Gantt says:

      Janis,

      Your suggestion seems to have worked. My blog has 1,467 posts, 31 pages, and 296 comments. Once I made the change you suggested, 28 links were revealed as broken, including the one that I intentionally broke.

      When I checked the “Server Load Limit,” it was set at 4. “Current Load” was showing 13.52. Then it continued to rise as I observed the page. I didn’t know where this might end, so, when it hit 19, I entered 20. Thereafter, over course of 15-20 minutes, your plugin identified the 28 broken links. I have four other blogs and I expect them all to have considerably more broken links than this one (I picked te easiest one first). I will follow your suggestion there, too.

      My remaining question is:

      1) Do I leave the setting at the higher number (20), or should I reduce it…and, if so, to the orginal setting or to some other number?

      2) Will this setting affect the loading time, or performance, of my blog site? I want to find all the broken links and fix them, but I also want to keep a high-performing, quick-loading web pages.

      Thank you for answering these questions, and thank you for your most helpful plugin. It really is a godsend because it helps me keep from frustrating my readers.

    6. Jānis Elsts says:

      The optimal load limit can vary greatly depending on the sever. I would recommend checking the current load a couple of times over a period of several hours/days until you get a decent idea of what the average load is like, then setting the limit to something slightly higher than that.

      As for performance – yes, on some servers this setting can affect page load time. If the load limit is very high and your site has a lot of links to check, the plugin might run non-stop and overload the server. On the other hand, if the limit is set too low, the plugin will just sit idle indefinitely and never check anything. Finding the best setting might take some trial-and-error.

    7. Mike Gantt says:

      Thank you for your software and your service.

    8. Chris says:

      FYI my broken links table is no longer showing up. Checked my PHP error logs, and this popped up [27-Mar-2014 18:01:54] PHP Fatal error: Internal Zend error – Missing class information for in /…/wp-content/plugins/broken-link-checker/includes/admin/table-printer.php on line 11

    9. Chris says:

      Something you may want to address in next update…

      https://bugs.php.net/bug.php?id=59298

      specifically removing space between ( and ! in the class_exists check at the top. That fixed the table not showing up.

    10. Jānis Elsts says:

      All right, I’ll remove the space. From my reading of the bug discussion this may not actually fix the bug 100%, but it’s an easy change to make.

    11. Jen says:

      Thank you for your wonderful plugin. It has worked perfectly up until last week so I’m wondering if you might have an idea as to how to fix the issue I’m having. Suddenly it is marking links that are not broken as broken. It says: Unknown Error for each link. I’ve attached a sample below. I extended the time out to 90 seconds but it didn’t help.
      Any thoughts on how to fix the issue?

      Link last checked: March 28, 2014
      HTTP code: 0
      Response time: 0.101 seconds
      Final URL: http://www.decascranberry.com
      Redirect count: 0
      Instance count: 1

      This link has failed 1 time.
      This link has been broken for 4 minutes.
      Log: Empty reply from server [Error #52]
      === (No response) ===

      Link is broken.

    12. Jānis Elsts says:

      It looks like the site in question is intentionally blocking BLC. Sorry, but I’m not sure there’s much I can do about that.

    13. BartC says:

      I have had BLC installed for some months now. It is telling me there are no broken links. But I just found a link that goes 404. It appears that BLC does not consider that broken, since something does come back in response to the browser query.

      Am I missing something in BLC setup that would flag these common errors.

      Here is the page with the broken link (scroll down a bit to the first link):
      http://adribarrcrocetti.com/main/2013/08/17/lemon-basil-sorbet-with-mixed-berries/

      Here is the actual link:
      http://lacucinaitalianamagazine.com/recipe/lemon-basil-sorbet-with-raspberries

      thanks…
      bc

    14. Jānis Elsts says:

      What status message does BLC display for this link? You can find all detected links (including working ones) in Tools -> Broken Links -> All. You can also use the “Search” button on the Broken Links page to search by URL or link text.

    15. Jen says:

      Thanks for your response. Based on your experience, do you have any idea what might block BLC? Most links are being falsely labeled as broken. I want to get it to work but I’m not seeing any plugins that would cause an issue. I was hoping you might have some insight. Thank you.

    16. Jānis Elsts says:

      In this case, it looks like it’s the linked site (www.decascranberry.com) that’s blocking the plugin. There isn’t necessarily anything wrong with your own server or your plugins.

    17. Alex says:

      Hello Janis,

      I’m working in a wordpress version of my site, and I install your plugin.

      My dubte is if BLC can check links in other plugins installed in wordpress.
      I mean… I have installed for exemple this plugin to create lists with links: Ultimate Tables [ http://www.extendyourweb.com/product/ultimate-tables/ ]
      And look that BLC doesn’t search for broken links inside Ultimate Tables.
      Here for exemple I put a broken link: http://payasos.info/wordpress/4902-2 that BLC doesn’t found.

      Is there a way to make that BLC search for broken links in other plugins?
      I see is one option in “Look for links in” that you need to put html:field_name but I don’t know how to do it.

      The code for Ultimate Tables is [ultimatetables 1 /] for the first list [ultimatetables 2 /] for the second one…

      I really appreciate if you can help me.

      Thanks.

    18. Jānis Elsts says:

      If I recall correctly, Ultimate Tables doesn’t store its tables as HTML (it uses a custom JSON-based format instead), so that wouldn’t really work. BLC needs to know how to interpret the contents of a post, page or custom field to find the links, and it can’t do that if they’re in some plugin-specific format.

      Unfortunately, there’s not much that can be done about that. In theory, it would be possible to make a custom parser that would help BLC read other plugins’ data, but you’d have to do this individually for each specific plugin. Given how many WordPress plugins there are, it’s not feasible to do this even for a small fraction of them.

    19. Alex says:

      Hi Janis,

      Thanks for your answer.

      Can you recommend me one tutorial or some web where I can found how to do a custom parser for plugins, so I can make your plugin search in other plugin?

      I am perhaps too bold with the limited knowledge I have :-p

    20. Jānis Elsts says:

      I’m afraid there is no tutorial for that, but BLC includes a bunch of default parsers that you can examine to see how they work. Take a look at the files in /broken-link-checker/modules/parsers and /broken-link-checker/modules/extras.

    Leave a Reply