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

      @ Carcotas:

      Yes, there is a module for checking embedded videos from vk.com, but it’s not included in the public release. Contact me by email if you need it.

      @ arksi:

      Theoretically, the plugin supports special characters in link URLs, and they seem to work fine on my test sites. In practice, however, some users have reported problems with special characters before. I’m not sure what the root cause is.

      Could you perhaps provide a few example images? You can send the links to my email (whiteshadow@w-shadow.com) if you don’t want to post them publicly.

    2. arksi says:

      Thanks for the quick reply.
      Here is a link to a post: http://wohnideenn.de/innendesign/05/25-moderne-ideen-kuchendesign-die-ihre-kuchenwelt-verandern.html
      the images there are reported as 404 NOT FOUND though you can see them in the post.
      In the broken links list they look like this:
      http://wohnideenn.de/wp-content/uploads/2013/05/mvk-gegenw?%A4rtige-k??che-582×392.jpg
      http://wohnideenn.de/wp-content/uploads/2013/05/modern-k?che-design3.jpg
      etc.
      As you can see the umlauts are replaced with “?”

      Regards

    3. Jānis Elsts says:

      Looks like it might be an encoding problem. Check your WordPress database – what’s the character set and collation of the wp_blc_links table? Also, are there DB_CHARSET and/or DB_COLLATE constants defined in your wp-config.php, and if so, what are their values?

    4. arksi says:

      Hi,
      the DB tables have collation utf8_general_ci. However for fileds url and final_url seem to have collation latin1_general_cs. Is this what might be causing the problem?
      In the wp-config file DB_CHARSET is set to utf8 and DB_COLLATE is left empty. Viewing the DB table data using phpmyadmin – i see the special characters correctly.
      Regards

    5. Jānis Elsts says:

      That’s normal, those two fields are supposed to use the collation latin1_general_cs.

      The only thing I find slightly suspicious is DB_CHARSET. Is there any particular reason why it’s set like that? Normally you don’t need to define it explicitly.

      Here’s what I would try:

      1. Comment out the DB_CHARSET and DB_COLLATE defines for now.
      2. Open the post that contains the images in the editor and, without making any changes, save/update it.
      3. Verify that the post still looks right, e.g. the images are still visible and so on.
      4. Wait for BLC to re-scan the post. This can take a few minutes.
      5. Check if BLC still reports the images as broken.

      If this doesn’t help or commenting out the define()’s breaks something, uncomment the two lines in wp-config.php and restore the previous post revision (if necessary).

    6. Jānis Elsts says:

      On second though, even if this fixes the links, it would probably break something else… Hmm.

    7. arksi says:

      Removing the db_charset most probably will result in breaking the content of the site. It is there for a reason – my colleagues placed it there.
      So i guess there is some mismatch in our usage of special utf8 chars and the way they are stored in the plugin table. If I try to change the collation of the DB table for those 2 fileds – will that affect the plugin correct functioning? Because if I use cyrillic in the urls at some point it will most probably crash.
      Regards

    8. Jānis Elsts says:

      Changing the collation of those fields may affect the plugin’s ability to retrieve URLs with special characters from the database. Of course, that didn’t work properly in the first place, so I don’t think it would get any worse. Go ahead and try changing it to utf8_bin or something like that.

    9. arksi says:

      will keep you updated what was the effect of the change 🙂

    10. rheyank says:

      thanks for this news, i will keep this plugin for my wordpress.

    11. Steven says:

      Even after turning the plugin off and on, I still get the following message on any blog that is not my primary blog:

      Broken Link Checker installation failed. Try deactivating and then reactivating the plugin.
      Failed to load plugin settings from the “wsblc_options” option.

      Option doesn’t exist in the wp_2_options table.

    12. Jānis Elsts says:

      The plugin does not fully support Multisite. Network activation won’t work; you’ll have to activate it separately on each site.

    13. Jual komik says:

      Dear Admin,

      Why my keyword with strike link

      sample
      keyword
      My keyword is name my domain

      http://direktori-bisnis.com/direktori-bisnis-indonesia.html

    14. Nono says:

      Dear Janis,

      Is it normal that the plugin seems to put all my https links to the status “Unknown Error” ?
      Is it related to my configuration ?

      another thing : I receive the email notification, every day at 11pm.
      Is it possible to receive it only once a week, in the middle of the day, instead of middle of the night ? 🙂

      Btw, thank you for your plugins !

    15. Jānis Elsts says:

      Is it normal that the plugin seems to put all my https links to the status “Unknown Error” ? Is it related to my configuration ?

      No, that’s not normal. It could indicate a problem with your server configuration – for example, maybe the server prevents outgoing HTTPS connections, or the installed version of PHP or the CURL library is buggy. What CURL version do you have? You can find it by clicking the “Show debug info” link on the BLC settings page.

      another thing : I receive the email notification, every day at 11pm.
      Is it possible to receive it only once a week, in the middle of the day, instead of middle of the night ?

      It’s not possible to switch the email notifications to a weekly schedule, but you can change the time when they arrive like this: disable email notifications, go to any other admin page, then go back to the settings page and re-enable notifications.

      This will change the time when the notifications are sent to the current time. For example, if you do re-enable notifications at 10:00 am, future notifications will be sent every day at 10:00 am (approximately).

    16. Torben says:

      Hi

      When posting a new post the plugin reports “broken link” 403 – if there is an image in the post it report 403. If a mark it “not broken” it don’t return a 403 later.

      Torben

    17. Jānis Elsts says:

      That usually means there’s something on your server that blocks “bot-like” HTTP requests for image file.

    18. Torben says:

      But image is not the only problem. The plugin returns a 403 for both image and the post. The plugin has never done that before. After marking “not broken” on both image an post everything is ok again.

    19. Jānis Elsts says:

      Well, all the plugin does is display the response that your server returned. I can only guess why the server would return “403 Forbidden” when the plugin tries to access the image(s) and the post(s).

    20. MidKnightt says:

      Is there a way to detect youtube videos that are no longer available?
      The link works but the video itself was removed.

    Leave a Reply