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,582 Responses to “Broken Link Checker for WordPress”

    1. […] Broken Link Checker plugin is an easy way to make sure that all of the links on your site — internal or external — […]

    2. George says:

      I have 345 broken links.
      The majority are 403 forbidden but internal links – what’s the significance?

      Do I need to do something?
      If so what?
      put /index.html/ on every link?

      G

    3. Jānis Elsts says:

      When you get a lot of “403 Forbidden” results on internal links it usually means that your site is blocking automated requests for some reason. There are multiple different things that could cause that: anti-hotlinking settings (mostly affects image links), poorly configured firewalls, .htaccess rules intended to prevent unauthorized access to parts of the site, password-protected links (BLC can’t check those), and so on.

      If none of the above sounds familiar, try asking your hosting provider about security-related software or settings that could be making the site return “forbidden” on loopback requests.

    4. […] Broken Link Checker – The larger the site grows and the older it gets, the more links that you once supplied or were added in comments might become outdated. Find and take action of the links that stopped working. […]

    5. […] Broken Link Checker (Fixed 800 problematic redirects and 257 broken links!) […]

    6. Brian says:

      Hi,

      I love your BLC and for years its worked great for me. However ever since the 1.10.1 update (the most recent) it now lists 32 links in the redirect that will not be fixed when I select redirect. They are to my own blog and they are 302 OK in the status column. I have tried multiple times to “fix redirects” as a group and individually but it doesn’t work. I have had links like these for years resolve correctly when I did the fix redirects before. What do I need to do to fix this?

      Thanks.
      Brian

    7. Jānis Elsts says:

      Here are a few things to check:

      – Does the plugin show a valid redirect URL for those links? To see the URL, either click the “302 OK” status message and look for the “Final URL” field, or enable the “Redirect URL” column in screen options.

      – Is the redirect URL different from the original URL? If the two URLs are the same, “fix redirects” won’t do anything.

      – In “Settings -> Link Checker”, click “Show debug info” and take a look at the Curl version, safe mode and open_basedir entries. Are all of them green? Do any of them mention redirects? For example, having open_basedir enabled could interfere with the plugin’s ability to detect and fix redirects.

    8. Brian says:

      Hi Janis,

      Thanks for responding so quickly. Yes, It does. I enabled the redirect URL as part of my troubleshooting process.

      No the two URLS seem to be identical.

      They are all green. I don’t see anything that says redirects:
      PHP version 5.2.17
      MySQL version 5.1.73
      CURL version 7.21.6
      Snoopy Installed
      Safe mode Off
      open_basedir Off
      Default PHP execution time limit 30 seconds
      Resynch. flag 0
      Synch. records 15995
      Link records 28811 (39501)
      Last email notification Never

      If you want to email me I can provide the full debug info log.

      Brian

    9. Jānis Elsts says:

      The debug info looks fine. That’s good, though it doesn’t tell us what the problem might be. (The installation log probably isn’t relevant in this case.)

      Lets try a different approach: what exactly happens when you select “Fix redirects”? Does it do nothing at all, or is there an error message of some sort? Does the page refresh? Does the plugin say it fixed the redirects, but the links stay unchanged?

      The next step would be to check the logs. Take a look at the PHP error log – are there any recent error messages related to BLC?

      If error logging is disabled on your server, here’s how to turn it on:
      http://codex.wordpress.org/Editing_wp-config.php#Configure_Error_Logging
      After turning on logging, try fixing redirects again and see if any new messages show up in the log.

      Similarly, turn on BLC-specific logging in Settings -> Link Checker -> Advanced. Do any errors show up in /wp-content/uploads/broken-link-checker/blc-log.txt when you click “Fix redirects”? Could you email me the log file?

    10. Brian says:

      Hi Janis,

      Thanks for helping me so far. Strangely when I went to check on the link situation it appears that the links that were problematic have disappeared! I am not sure what to make of it. I think part of the problem is that the majority of them were pointing to StumbleUpon, which might have had a temporary outage.

      Thank you for your help. I will be sending a donation on payday.

      Brian

    11. Olaf Lederer says:

      Hi,
      your broken link checker plugin is removed from the WordPress repository. Is this by accident or is there a reason for that?

      regards
      Olaf

    12. Jānis Elsts says:

      Somebody reported an alleged security vulnerability in the plugin. Apparently, standard policy is to immediately hide the plugin from the repository while the report is being investigated.

      I replied to the report yesterday. There has been no response from wordpress.org yet.

      In case you’re curious, the supposed vulnerability has to do with the fact that WordPress lets editor and admin users create links with a URL like “javascript:alert(123)”. Clicking a link like that will execute the JS code. Technically, a malicious editor/admin could use this to insert malicious JS code in a post. BLC would then display the link under “Tools -> Broken Links -> All”.

      Of course, someone could just view the post and click the link there instead of going through a plugin.

    13. Lately the plugin has started checking *draft* posts (which were once live) and finding “broken” links to other *draft* posts (which were also once live.)

      Is this because the posts were once live? If so, is there a simple fix?

    14. Jānis Elsts says:

      When did that start to happen? There was a bug related to changing post statuses, but that should have been fixed in version 1.10.

      Check “Settings -> Link Checker -> Look For Links In” and verify that the “Draft” status hasn’t gotten enabled somehow. Save the settings, then try deactivating and reactivating the plugin. The problematic links should disappear from the “Broken Links” page pretty much instantly.

    15. The settings were correct, but disabling/enabling (after updating the plugin yesterday) seems to have done the trick. Thanks. (As a computer guy, I should have made “reboot” my first troubleshooting step, eh?)

    16. Turns out it fixed MOST of the problems.

      The tool is still checking links which are commented out in the HTML code. Is there a better fix than dismissing them (in case I make those links live again someday?)

    17. […] plugin Broken Link Checker do WordPress monitora toda a linkagem quebrada nas páginas do seu […]

    18. […] en ‘previous’. Contactform: Hiermee heb ik het contactformulier gemaakt. Broken Link Checker: Hiermee zoek je links op binnen je blog die niet meer fungeren. Next Gen Gallery: Hier maak je een […]

    19. Jānis Elsts says:

      That’s a known bug. The plugin doesn’t respect HTML comments. It will parse commented-out code as if it wasn’t commented out.

    20. […] for managing the back-end of your blog including, Redirection, Broken Links, WordPress SEO, MDR Webmaster Tools, and W3 Total […]

    Leave a Reply