Broken Link Checker for WordPress

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.

Download it now! (10 KB)

Features

  • Checks your posts (and pages) in the background (whenever the WP admin panel is open ).
  • Detects links that don’t work and missing images. Checks both internal and outbound links.
  • Notifies you on the Dashboard if any problems are found.
  • Link checking intervals can be configured.
  • New/modified posts are checked ASAP.

The broken links show up in the Manage -> Broken Links tab. If any invalid URLs are found a notification will also show up in the sidebar on the Dashboard.

The Broken Links tab displays a list of invalid URLs found along with the relevant posts and the anchor text of the links. “View” and “Edit Post” do exactly what they say and “Discard” will remove the message about a broken link, but not the link itself (so it will show up again later unless you fix it; this plugin doesn’t modify your links).

By default all old posts/links are re-checked every 72 hours, or you can set a different time period.

Notes (Semi-Technical)
I realize there’s a lot of features that could be added to improve this plugin considerably. However, this release is intended to “test the waters” and see if there’s demand for a plugin like this, so I only implemented the most basic functions. The plugin has been upgraded to be slightly beyond “basic” ;)

I thought about using WP’s pseudo-cron to run the link checker by schedule and decided against it. AFAIK the cronjobs execute when a page is requested; since this plugin does some lengthy processing it may increase page load times unacceptably when used in this manner. That’s why I set it to run the checks asynchronously (AJAX) and invisibly in the admin panel.

Installation
Just like any other WordPress plugin -

  1. Download (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.

Upgrading

  1. Deactivate the plugin (important!).
  2. Do steps 1.-3. from “Installation”.
  3. Upload the broken-link-checker folder to you wp-content/plugins directory.
  4. Re-activate the plugin in the Plugins tab.

DownloadCC-GNU GPL
Version 0.3.5 : broken-link-checker.zip (10 Kb)
(It needs at least WordPress 2.0.x to work, maybe 2.1.x. I’ve tested on 2.1.3 - 2.5)

Share :
  • Digg
  • del.icio.us
  • Reddit
  • StumbleUpon
  • Technorati
  • Slashdot
  • Sphinn
  • TwitThis
Related posts :

345 Responses to “Broken Link Checker for WordPress”

Pages: « 12 3 4 5 6 7 8 9 [10] 11 12 » Show All

  1. 256
    R. Richard Hobbs says:

    I think the broken link checker hmight have a problem with del.icio.us (wonder if their nofollow is part of it?) BLC is showing false positives for just about ALL my del.icio.us tag links. For about a month earlier this year I was doing a LOT of bookmarking on delicious and was having del.icio.us do a daily post to my blog since the bookmarks were of mostly useful, relevant content - in a nutshell, I have LOT of del.icio.us bookmark links on my site and BLC is showing 3000+ bad links I have nary the time to go thru by hand so I ‘d be tickled pink if there arose a automagical remedy to this problem. - thx

  2. 257
    White Shadow says:

    @R. Richard Hobbs - Del.icio.us links seem to work fine on my test blog, so I’m guessing the problem is site-specific. I can only suggest you add del.icio.us and delicious.com to the exclusion list in Settings -> Link Checker.

  3. 258
    R. Richard Hobbs says:

    >>> I can only suggest you add del.icio.us and delicious.com to the exclusion list in Settings -> Link Checker.

    <<< thanks for that - I really only turned BLC back on yesterday after I had deactivated a while back. I have been keeping it updated but I hadnt really noticed that feature - thx again

  4. 259
    R. Richard Hobbs says:

    Feature request: make links to check open in new tab or window
    Feature request: make your comment form remember me

    thx

  5. 260
    White Shadow says:

    @R. Richard Hobbs - Could you clarify what you mean by “links to check”?

    As for the comment form, I’m aware of the problem - it’s caused by the same plugin that handles comment paging. I’ve let the author know about this bug, but it’s not fixed yet. And I think disabling the plugin would be a bad idea - for example, this page would take forever to load with >250 comments on one page.

  6. 261
    R. Richard Hobbs says:

    >>> Could you clarify what you mean by “links to check”?

    <<< after the BLC has done its work you are presented with a list of bad links it has found (it’s”edit” link is next to each of these) I’ll call this the “work page”… Normally I will confirm for myself they are bad if just click on each link you are moved off the work page and have to go back after following the link unless it is opened in a new tab or window. Its a relatively small chore but little things matter if there are a lot of links to check. Automatically opening the link in a new tab (or giving users the option on the config page would please me immensely.

    Another suggestion might be to be able to select all the text automatically (like the “embed” box on Youtube) in the edit form window. There appear to be lots of free javascripts that do this. Admittedly I havent gotten in there and tried it so I cant say exactly how easy or hard it might be to implement this, but for me it would be a helpful feature.

    Thanks again for your hard work and kind ear.

  7. 262
    White Shadow says:

    @R. Richard Hobbs - Ah, I usually just middle-click those links which opens the link in a background tab in Opera. Anyway, I’ll make them open in a new window by default (the window/tab distinction is browser-specific, can’t control it from JS AFAIK).

    I’ll see what I can do about auto-selecting the text.

  8. 263
    SleeplessinDC says:

    We’ve been able to fix many bad links in the resources lists on our site. But there are four links that it keeps marking as bad links that are really good links. Why are these URLs being marked as bad? (I tried putting them in normally but your comment form thinks it is spam so I’ll try the following to see if that gets accepted.)

    www dot accessible dot ie
    www dot accessible dot ie/?p=50
    www dot natural-access dot com
    www dot eschoolnews dot com

    Thanks.

  9. 264
    White Shadow says:

    @SleeplessinDC - Those links work fine in my tests. Anyway, the next version of the plugin will have more detailed reporting which should help you figure out why the links get marked as broken.

  10. [...] of link checkers on the internet, but for all you WordPress-ers, there’s an easier way - the broken link checker plugin. I recently installed and ran it on one of the sites I look after, and it came up with a list of [...]

  11. 266
    CID says:

    Hi there,

    I thought I’d give BLC a try in WP 2.6(.1). No (PHP/WP) errors but it marks perfectly fine links as ‘broken’ while they’re obviously not! At first I thought it only did that with ’shorthand’ links like domain dot com instead of www dot domain dot com but it has now also marked other ‘good’ links as ‘broken’…

    This somewhat negates the use of BLC…

    However: Great plugin and I’m looking forward to seeing any issues resolved or more documentation on ‘why BLC marks those links as broken’ becomes available.

    Thanx!!!

  12. 267
    White Shadow says:

    @CID - If you have the latest version (0.4.8) you should be able to get some clues as to why those links were marked as broken by clicking the new “Details” button(s) in Manage -> Broken Links. However, meaningful info will only be available about “broken” links that were checked with this newer version.

  13. 268
    CID says:

    Hey WhiteShadow,

    Thanks for your quick response!
    Yes, I do have version 0.4.8 and it lists ‘details’. However, every link detail (except the URL’s and time ofcourse) reads:

    ——————————————————————————
    Last checked : 2008-09-09 12:06:09
    Final URL : http://www.cid-iv.com
    HTTP code : 0
    Log :
    === First try : No response. ===

    Trying a second time with different settings…
    === Second try : No response. ===

    Link is broken.
    ——————————————————————————

    The sites load fine but BLC keeps getting ‘no response’…

  14. 269
    White Shadow says:

    @CID - It’s probably timing out. The timeout is hardcoded to be about 30 seconds (when using CURL). Maybe I should add an option to configure it…

  15. 270
    CID says:

    Yes, well, that would, in any case, be a welcome addition. Always nice to be able to set the threshold for this kind of functionality. But I don’t think that that’s the case here because the site (mentioned in the example) loads in under 2 seconds… (Checked with Fasterfox.)

  16. 271
    White Shadow says:

    @CID - Maybe the site has some kind of security software in place to prevent suspicious bots from accessing it. Wouldn’t be the first time.

  17. 272
    CID says:

    Ok, yes, that would cause such behaviour, I will check!
    But how about the internal links it marks as ‘broken’?
    And to me it seams that it has problems handling shorthand URL’s. Or can’t that be the case?

  18. 273
    White Shadow says:

    @CID - “shorthand” URLs shouldn’t be a problem if the URL is otherwise valid and working. In particular, external links should always include the protocol part (usually http://).

    Are the local links using relative URLs? The plugin should handle it, but the algorithm is not perfect.

  19. 274
    Bart Gibby says:

    ~ bug ~
    When I activate the plug-in my website bleeds through the admin. So I can actually see my website below with some themes the admin, and integrated with the admin in other themes.
    ~ end bug ~

    has this been fixed yet?

  20. 275
    Bart Gibby says:

    When I search for “broken link checker” in the wordpress plugins search I do not see your plugin any more. What happened?

    http://wordpress.org/extend/plugins/search.php?q=broken+link+checker

  21. 276
    White Shadow says:

    @Bart Gibby - The WordPress.org plugin search is notoriously bad. The plugin page is still up.

    As for the “bug”, check that wsblc_ajax.php is present in the plugin’s folder (i.e. in wp-content/plugins/broken-link-checker/) and that it doesn’t have any weird permissions set. Actually, just see if you can access yourblog.com/wp-content/plugins/broken-link-checker/wsblc_ajax.php. You might have a .htaccess rule or some security module blocking it. Or possibly your “wp-content” folder isn’t where the plugin expects it to be.

  22. 277
    cartmanffc says:

    Broken Link Checker is not compatible with Ozh Better Feed

  23. 278
    White Shadow says:

    @cartmanffc - Okay, thanks for the info.

  24. 279
    Stefan says:

    If i’am klick on ‘unlink’ in the list of Broken Links, The complete text of the Artikel is deleted!

    I’am working with the newest Version of WordPress 2.6.2!

  25. 280
    White Shadow says:

    @Stefan - Err, sorry? That has never happened in my tests :/ If you have backups (hopefully you do) could you mail me the post (including HTML etc, not just the text) that got deleted? My email is whiteshadow (et) w-shadow (dott) com
    I would run some tests with that posts and try to find the cause of the problem.

  26. 281
    alice says:

    Love the plugin — it works so much better than any other link checker I’ve tried! Sadly, I had to turn it off after upgrading WP because of server load problems (I’ll keep an eye out for updates that address this issue!).

  27. 282
    White Shadow says:

    @alice - Thanks :)
    I haven’t been able to pinpoint the source of the performance issues yet as only certain people/blogs seem to have them. The plugin has always been running well on my sites.

  28. 283
    alice says:

    White Shadow,

    I’ve been thinking about the server load problem and how only a few people seem to have run into the issue. In trying to come up with reasons I might have had the problem where others didn’t, I came up with two possibilities:

    1) my blog goes back to July, 2004, so there are a lot of entries with an abundance of links, which could have kept the link checker pretty busy; and

    2) and this one is probably the more important one: I tend to just leave my dashboard open in a browser tab all the time. Since your plugin is designed to work certain intervals whenever the dashboard is open, that means that I’m letting it work around the clock. Maybe there needs to be a setting to slow down the link checker if the dashboard is left open for long periods of time?

    Anyway, maybe this info might be of some use to you.

    Have a great weekend,

    Alice

  29. 284
    White Shadow says:

    @alice - So is the slowdown you experience really occuring on the server, or just in the browser? If you try to access the site from a different computer when you have the dashboard open on another, does it still load more slowly than usual on the other computer? That would help narrow down the range of possibilities.

    I don’t know if this would help, but here’s an idea - go to the plugin’s settings and increase the “Check every post” value to ~160 hours. Also increase “work session length” to 60-120 seconds. It might reduce the load, or it could make it worse, or do nothing, but it would be an interesting data point.

  30. 285
    mobile software says:

    what difference of this and google webmaster tools ?!
    thanks for share this plugin.

Pages: « 12 3 4 5 6 7 8 9 [10] 11 12 » Show All

Leave a Reply