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)

Related posts :

315 Responses to “Broken Link Checker for WordPress”

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

  1. 225
    Search Engine Optimization wordpress - Says:

    [...] ) 15-Auto Social Poster 16-Broken Link Checker 17-Global Translator [...]

  2. 224
    White Shadow Says:

    Nah, it makes perfect sense ;)

    Actually I need a regexp for HTML links. I think I’ll need to update the existing one to use a backreference to ensure it only accepts matching types of quotes for the opening and closing quote of the href parameter (I think that sentence got a bit tangled).

    Anyway, I’m putting that off, because currently I have a more pressing issue - finding out how somebody managed to hack this site today. I’ve got it back working, but now I need to read the logs and whatnot…

  3. 223
    Michael Hampton Says:

    The official regex for URIs is ^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?

    Confused yet? :)

  4. 222
    White Shadow Says:

    @hillman - There is no log.

    The plugin can probably get confused by links that contain a quote. I’ll need a more advanced link-finding regexp to solve that, but it’s doable.

  5. 221
    Branko Collin Says:

    Xenu Link Sleuth produces some sort of error message on Wikipedia links (”forbidden”), I am guessing the same thing that stops XLS also blocks the BLC4WP.

  6. 220
    hillman Says:

    @White Shadow - I see. Perhaps I’ll just discard those errors. Thanks for the reply!

    Does Broken Link Checker keep a log of the checking result? Like, whether it reports the link as broken coz it gets a 404 or 503 when checking?

    Also, one of the link in my blog is linking to:

    http://en.wikipedia.org/wiki/Pandora’s_box

    but BLC is reporting the link as:

    http://en.wikipedia.org/wiki/Pandora

    Does it stumble on single quote in the URL?

  7. 219
    White Shadow Says:

    @hillman - Wikipedia links work okay (i.e. not detected as “broken”) on my blogs, but some other users seem to have problems with them. Maybe it’s really a problem with your server, or maybe Wiki is blocking certain ranges of IP addresses.

  8. 218
    hillman Says:

    This is a great plugin! Except that it’s reporting links to nearly all Wikipedia pages as broken, while they not. Such as:

    http://en.wikipedia.org/wiki/Pandora
    http://ja.wikipedia.org/wiki/%E7%A5%9E%E3%81%AE%E9%9B%AB

    Is there something funny about these Wikipedia pages? Or is it just that the Wikipedia web sites can’t be reached from my host?

  9. 217
    Ménage de printemps en été sur le blog | Sur le fil technologique Says:

    [...] Le nettoyage consiste à vérifier et corriger les liens morts. Pour cela, j’ai installé le plugin Broken link checker [...]

  10. 216
    White Shadow Says:

    @Bleh - Depends on your browser… I’ve had no problems with it :P

  11. 215
    Bleh Says:

    BLOATWARE ALERT… caused my blog to take FOREVER to load… probably because I have LOTS of content… but still! This is hardly “running invisibly in the background”!!!

  12. 214
    Repairing Links | Working Hard On The Internet Says:

    [...] the Wordpress Broken Link Plug In, I found that along with the hundreds of links to my old web site I had over 160 broken links on my [...]

  13. 213
    Some Thoughts On WordPress 2.6 (and Plugins Galore) - Part Two | afewgoodpens.com Says:

    [...] Broken Link Checker scans all your articles and their internal links to verify that none of them are broken. I haven’t kept this plugin continuously active, though did check my entire site after upgrading and changing many of my categories, and, happily, there were no broken links. [...]

  14. 212
    Best 35 Most Popular Wordpress Plugins | TechCafe4u Says:

    [...] Broken Link Checker - This plugin will monitor your blog and looks for any broken links and let you know if any broken links are found. [...]

  15. 211
    Related Posts Account Suspension | (Anti) Social Development Says:

    [...] for almost 6 years and have not made many changes to it recently. I had, however, installed the Broken Link Checker plugin and thought that was the culprit. Anyway, I told my host that I would remove the problematic [...]

  16. 210
    Denis Says:

    @White Shadow - @White Shadow - Sure, it’s italian :-P However if I deactive the plugin, all things works right again… See you

  17. 209
    White Shadow Says:

    @Denis - Riiight. I can’t really read that (as I don’t know the language), but if you mean the “Internal Server Error” thing it’s probably caused by some tricky server configuration conflict. For example, it could be some security-related Apache module that causes this, or a .htaccess thing.

  18. 208
    Denis Says:

    Hello! I think that this plugin is really useful… However, I noticed that with wordpress 2.6 can give some problems. Watch this post in my blog:aggiornamento-a-wordpress-26

    I think this can help to solve the problem.

    Thank you and see you soon,
    Denis

  19. 207
    White Shadow Says:

    @Kate - It’s not easily extendable - you’d need to edit the source code. If you’re up for that, what you need to do is replace two references to ‘manage_options’ (around line 340) with ‘edit_others_posts’. This should give editor-level users access to the plugin.

  20. 206
    Kate Says:

    I think this is an excellent plugin, thanks so much for your work on it.

    Our blog has many levels of users. We’d like to allow editors to use the Broken Link Checker, but they have “insufficient permissions.” Is there a way to extend permissions beyond just administrators? Thank you.

  21. 205
    White Shadow Says:

    @Michael Hampton - I’ve thought about your problem for a while and haven’t thought up anything useful. I don’t know why it’s stalling. I’ll let you know if I get any ideas.

  22. 204
    Michael Hampton Says:

    Er, excuse me, I seem to have version 0.4.4. not 0.3.5.

  23. 203
    Michael Hampton Says:

    Hey, I’ve got some oddball stuff going on here with version 0.3.5. Specifically it seems to run for a while, and then gets stuck at, for instance, “3 posts and 9278 links in the work queue.” It’s been sitting here for four days, despite having the setting to recheck everything every 72 hours. Any idea how I can figure out what’s going on?

  24. 202
    White Shadow Says:

    @Rob Vegas - That’s a good idea, but I think there are already plugins that can do this. I’m pretty certain I’ve seen some “global search & replace” plugins before, Google may turn some up.

  25. 201
    Rob Vegas Says:

    i have the problem that my wordpress blog is now running on new webspace and of course your plugin found morgen than 500 broken links.

    so it would be great to change all broken links at the same time.

    http://www.xyz.de/wordpress to http://www.123.de/wordpress

    so maybe you can include this possibility to your plugin! :-) would be great!

    change all xyz to 123 !

  26. 200
    Readers Edition » Fünf nützliche Wordpress-Plugins Says:

    [...] der englische Name des Plugins schon erahnen lässt, untersucht “Broken Link Checker” Ihren Wordpress-Blog automatisch nach so genannten toten bzw. verweisten Links. Sollte die [...]

  27. 199
    WordPress-Plugins: Warnung vor Broken links Remover und Broken Link Checker - Alter Falter! Says:

    [...] stolper ich über das WordPress-Plugin Broken Link Checker. Das ist gut, denk ich. Der Checker entfernt die toten Links nicht gleich, der checkt die [...]

  28. 198
    Fünf nützliche Wordpress-Plugins | ANDERSDENKEN20 Says:

    [...] der englische Name des Plugins schon erahnen lässt, untersucht “Broken Link Checker” Ihren Wordpress-Blog automatisch nach so genannten toten bzw. verweisten Links. Sollte die [...]

  29. 197
    White Shadow Says:

    @Michael Hampton - I think it makes sense to change/remove all broken links, so I won’t change that. I’ll look into fixing the Discard/AJAX issue though.

  30. 196
    Michael Hampton Says:

    Oops, I think I found another one. If there are two or more links to the same URL in the same page, editing, discarding or unlinking affects all of them. This isn’t necessarily desirable. In my case I wanted to edit one and unlink the other, but both of them got unlinked and I had to put one back in.

    And if you hit Discard, then while all of them get discarded, only one of them is removed from the listing via AJAX.

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

Leave a Reply