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. 45
    averagecoder Says:

    @White Shadow: You’re right, it seems to be working as expected. I am not sure why it reported false broken links before. I will keep monitoring the behavior .
    _______________

    Daniel

  2. 44
    White Shadow Says:

    I’m not entirely sure why it showed up as broken in your blog. Nevertheless, I’ve made some tweaks to the plugin and it should now handle that URL correctly. At least it does on my test blog ;)

  3. 43
    averagecoder Says:

    FYI: I changed my blog permalink structure and I use .htaccess file to redirect 301 all pages with the old permalink structure targetting to the new permalink structure, then I install BrokenLinkChecker.

    BLC installed successfully BUT, this URL:

    http://www.averagecoder.net/programming-tips/wordpress/how-to-easily-display-a-cute-google-map-inside-your-wordpress-post/

    Which is working when you access it via web browser is identified as broken link by BLC.

    I think it’s a good idea if BLC can works in conjunction with .htaccess rewrite rules.
    _______________

    Daniel

  4. 42
    Blogging With Wordpress | Kinshuk Sunil Says:

    [...] Broken Link Checker: Checks your posts for broken links and missing images and notifies you on the dashboard if any are found. By Janis Elsts. [...]

  5. 41
    Your site should be free of broken links | CleverSage Says:

    [...] Broken Link Checker - Checks your posts (and pages), looking for broken links and lets you know if any are found.  Email this to a friend [...]

  6. 40
    FruityOaty Says:

    I TOTALLY LOVE this plugin… which is one of the most useful WordPress plugins I’ve come acrossed. I wish it would check broken links in comments… That would make it even more better. :)

  7. 39
    Dvvarf Says:

    I want complain on XHTML validation when enabling this plugin with broken link CSS turned on. It says that broken-link bla-bla is not valid.
    Here is the solution (may be author would add this to further versions):
    1. Open broken-link-checker.php.
    2. Find there string:
    echo ”,$this->options['broken_link_css'],”;
    3. Replace it with:
    echo ”,$this->options['broken_link_css'],”;
    4. Save and upload changed file on server.
    Thats all! Thank you for your attention. =)

  8. 38
    Moving to WebDiggin.com | WebDiggin.com: An Adventure to Make Money Online Says:

    [...] So we had to go through all of our links to fix them one by one. (We are using a broken link checker plugin which identifies the posts where the broken links are hiding in, however, we still have to [...]

  9. 37
    Plugin: Broken Links » Beitrag » SaarBreaker Says:

    [...] Wordpress Plugin Broken Links, welches ich vor ein paar Tagen aufgenommen habe, ist ein unverzichtbarer Link Checker. Dieses [...]

  10. 36
    ø Broken Link Checker Plugin Version 0.3 | W-Shadow.com ø Says:

    [...] Link Checker Plugin Version 0.3 I’ve gotten some interesting feature suggestions for my link checker WordPress plugin since I released the last version several months ago. During the last week I finally got around to [...]

  11. 35
    A Plugin for Checking Broken Links : Adrian’s Domain Says:

    [...] like to click on a broken link? There are a few ways to remedy this solution, but I found this broken link checker for WordPress that does the job extremely well and is completely free. You do not want your readers to be annoyed [...]

  12. 34
    Au sujet des plugins WordPress utilisés | Iconique.net Says:

    [...] Broken Link Checker 0.2.5 (Janis Elsts) :ce plugin vous permet de vérifier que vous ne proposez pas de lien mort sur votre blog. Un plugin de ce type est indispensable à quiconque est soucieux de proposer un contenu à jour. Un de ces services que l’on devrait absolument trouver en standard sur WP. [...]

  13. 33
    Weeding in the blog garden :: Waveflux Says:

    [...] visitors to older posts have been running into the odd dead link, I searched for and easily found another great WordPress plugin that folds neatly into the blog’s administration and compiles a list of broken links, both [...]

  14. 32
    White Shadow Says:

    Yes, it does. In fact, I just upgraded to 2.3.3 and it seems to be working okay.

  15. 31
    AudioPill Says:

    Does it works on WordPress 2.3.2?

    thanks…

  16. 30
    White Shadow Says:

    I don’t see why it wouldn’t work as it is (it does on this site), but I’ll change it anyway - it won’t harm anything :)

  17. 29
    RNT Says:

    Hi!
    The link “View” at the broken-links don’t work to me.
    I fix this with:

    Please apply this patch to your next release.

    $ cat broken-link-checker.php.patch
    347c347
    < post_id’ class=’edit’>View

    > post_id).”‘ class=’edit’>View

  18. 28
    My Beautiful Chaos Says:

    Sunday Stroll…

    Tamar Weinberg over at LifeHacker pulls out a post from Mother Tongue Annoyances that strives to help us all with that big Public Speaking Fear. Follow this advice and then come practice it at Toastmasters.
    Found out about a great new WordPress Plugin …

  19. 27
    Meine Top 10 Wordpress Plugins Says:

    [...] Broken Links Auf dieses Plugin möchte ich nicht mehr verzichten. Nichts ist schlimmer, als seine Leser mit nicht erreichbaren Links zu versorgen. Dieses Plugin prüft alle Links und meldet Fehlerhafte. Damit man nicht lange suchen muss, wird angezeigt, welcher Link in welchem Beitrag den Fehler hervorruft und kann mit einem Klick auf Edit, diesen händisch bereinigen. [...]

  20. 26
    QCQ - Check Your Blog For Broken Links? : Jamie Harrop | Young Entrepreneur | Video Blog Says:

    [...] just found a fantastic WordPress plugin to check for broken links. I’ve installed it and it’s checking my blog as I type this. It’s found nine [...]

  21. 25
    Wordpress Plugin zum Link-Check Says:

    [...] Plugin nennt sich Broken-Link-Check Bookmarken [...]

  22. 24
    White Shadow Says:

    I checked some of these false positives and concluded they occur due to a bug. It was a relatively simple one and I think I have fixed it now. You can download the new version from this post (above). Or you could wait for the update notification which will appear in a few hours.

  23. 23
    Imagiscape Caregiving Says:

    Here are a few false positives - the checker says these are broken, but they aren’t.

    http://www.amazon.com/Elements-Organic-Gardening-Prince-Charles/dp/0297844164/ref=sr_1_1/002-6538492-7010462?ie=UTF8&s=books&qid=1190925978&sr=8-1

    http://astore.amazon.com/gristmagazine/detail/1576753611/102-1183543-3665742

    http://www.imdb.com/title/tt0090798/

    http://www.louvre.fr/anglais/collec/peint/inv0054/peint_f.htm

    http://www.algds.com/

    http://pressroom.pbs.org/photos/brain_fitness_merzenich?programid=the_brain_fitness_program_with_dr_michael_merzenich

    (205 links correctly identified as broken, 6 falsely identified.)

    On the wp-admin/options …, I selected Link Checker, then clicked “Recheck”. It returned “No broken links found”. Surely it should say “No new broken links found”.

    Then I checked Manage - Broken Links, and this time it only showed 3 broken links. I re-loaded the page, and it showed 6, then 11, then 60 then 139, then 181, then 189.

    All the above false positives appeared again.

    And there’s one new false positive:

    http://www.imagiscape.ca/wiki/tiki-index.php?page=Breakfast+of+Champions

  24. 22
    White Shadow Says:

    Thanks, and I’ve noted your suggestion. Though with the Christmas/etc coming closer I’m getting lazy, so don’t expect it to be implemented anytime soon ;)

  25. 21
    Imagiscape Caregiving Says:

    Thanks - it works perfectly!

    Suggestion:

    Add a field/column: Status (published/ draft/ private/ pending moderation/ …)

    Perhaps also allow filtering by status.

    I have 211 broken links, but 175 are from 7 draft emails.

    (They were published, but I had already found they were a mess, so the proper status is un-published - I wish we could designate them as such, not as drafts, but sorry, that’s not about your plugin.)

    It would be easier to deal with the broken links if I could only address the published ones.

    OR

    Add an ignore list, so I can check a box, or copy and paste something, or if need be enter the post id#, so that those broken links won’t display, but a note will, reminding: “the following posts/pages are on your ignore list - they may contain broken links not listed above”.

    Thanks again.

  26. 20
    White Shadow Says:

    Eh, I usually try to fix any reported bugs, but diagnosing a random error on somebody elses site is, as you can probably imagine, very hard. So no guarantees.

    I suspect third-party/hobbyist plugins in general tend to remain in “eternal beta” :P

  27. 19
    Laurens Says:

    The ‘Error 500′ messages appear at random but frankly scare the hell out of me.
    Looking at temporary alternative solutions to check links I tried an online service (http://www.dead-links.com) a few minutes ago but that also reports error 500 issues!

    I have deactivated your plug-in. As a fairly unexperienced Wordpress user, I have no idea what exactly is going on and don’t want to run into a situation that I cannot possibly fix myself without reinstalling. I guess it is better for me to stay away from beta plug-ins but once it gets a bit more reliable I’ll be back.

  28. 18
    White Shadow Says:

    Okay, I took some links from the page you mention and fed them into my local copy of the plugin… some of them turned out saying “broken”. I decreased the number of links in a single post to around 30 and they all checked out as not broken then… not good.

    Some kind of timeout still seems likely. In addition to the network timeouts there’s also the script execution timeout, often enforced on shared servers - this causes any scripts that run for longer than X seconds be terminated. If the plugin is running over this limit it might behave inconsistently. I’ll look into it (might take some time). Meanwhile, set the timeouts you changed back to the defaults and see if changing the “session length” in the options tab to something in the range of 10 - 15 seconds is any help.

    What about “Error 500″? How/when do you get those? I’ve never seen the plugin cause them myself.

  29. 17
    Laurens Says:

    Forgot to mention that there is indeed a constant in the incorrect reporting of broken links: it typically happens on pages with 20+ links in them. Problem is that I have a few dozen of those on my site - with the above page holding over 100 links.

    Of course I wouldn’t need your plug-in if I didn’t have loads of links on my site :-)

  30. 16
    Laurens Says:

    I doubled those two time-out values but this does not solve the problem.

    I am also troubled by ‘Error 500′ issues when using the ‘Broken links’ plug-in. This forces me to log-out of my Wordpress session - pretty annoying!

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

Leave a Reply