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. 105
    Blaenk Denum Says:

    Yeah I do, maybe in that time I’d have learned AJAX and done it myself :P But I’m glad you think it’s a good idea anyways and have added it to your todo list, though I’m curious as to how you couldn’t have thought of it before :P Really though, it’s obvious that it would make your plugin truly complete. Thanks for the consideration!

  2. 104
    White Shadow Says:

    My AJAX experience is a bit limited, but the idea seems doable and useful. I’ll add it to my “idea file” (aptly named arrgh.txt), though I make no promises as to when it’ll be implemented.

    You see, if I immediately went after every suggestion I get for my programs, scripts and plugins, I would never get anything new done (well, I do usually fix reported bugs ASAP). So it might take a while for me to get around to it. I’m sure you understand ;)

  3. 103
    Blaenk Denum Says:

    Hey White Shadow, first of all thanks for the plug in! The only problem is I have 160 broken links (I changed my domain name…heh) and so it becomes a hassle having to click ‘Edit Post’ for each broken link and search for the link within the post. I’m sure the majority of the people if not everyone using your plugin have around the same amount of broken links if not more, after all if it weren’t that many they wouldn’t have a use for this plugin in the first place.

    For this reason I’m wondering how feasible it would be to implement a feature with AJAX where, within the broken link list, one can click the broken link URL or something and it becomes a text box, and then once someone clicks outside of the box or a button, it changes the link that way. It would be tremendously helpful. I would do it myself but I’ve no AJAX experience let alone Javascript experience (I just occasionally hack away with my knowledge of other languages). However if you do (And I really hope you do) choose to try to implement this, I would be glad to test this it for you if you need testers. Just wondering if you’ve ever thought about that, I’m positive everyone using this plug in would benefit from this.

  4. 102
    White Shadow Says:

    To be honest, I don’t know. Maybe some of the plugin files were corrupted and reinstalling fixed it. Or maybe it’s the full moon that makes it work :)

    @Jez, Jandry : The Wiki link works on my blog. Maybe Wikipedia is blocking automated access from your site (some sites tend to do that).

  5. 101
    Abi Says:

    Right this is strange, i went all the way back to original version and uploaded it and it worked fine. No error 500 so i thought i would test for you all way through to see what version broke. I got all the way to the newest version which is now appearring to work fine so far??? In doing this i completely deleted the borken links directory before uploading the new version? Has this had anything to do with it now working?

  6. 100
    jez Says:

    I can confirm the wiki issue.

  7. 99
    White Shadow Says:

    @Abi : The plugin has always used AJAX, since the very first version. I also find it highly unlikely that your host “doesn’t support AJAX”. After all, AJAX isn’t something that you need to enable or install server-side. Anyway, you could try to install an older version of the plugin and see if that works. You can find the previous versions here.

    @Jandry : I’ll check the link on my blog. We’ll see how this goes.

  8. 98
    Abi Says:

    Hi

    I spoke to my host and figured why i was getting error500 with this plugi. they say they do not support AJAX at moment ???? Thing is the plugin did use to work, can i revert back to an old version. Is AJAX for recent versions? I am puzzelled. All i know is it used to work and the host are saying that they have never allowed AJAX so they dont know why it did? Can you advise pelase ?

    Thanks

  9. 97
    Jandry Says:

    Hi, Great plugin. But it seems not to be working with wikipedia links.
    The following link is detected broken
    http://fr.wikipedia.org/wiki/Jackson_Richardson

  10. 96
    White Shadow Says:

    If you really have the new version there should be a more detailed error message in parentheses after the basic message. Or just empty parentheses if the error was that there is no error ;)
    Eh, I don’t know.

  11. 95
    jez Says:

    I do now get “Error: Couldn’t update the post” (with the brand new version)

  12. 94
    White Shadow Says:

    jez, I don’t see anything in the code that could cause this. In fact, you should never see that error message, except when the post containing the link no longer exists at the moment you click “Unlink”.

    I’ll make the error reporting a bit more verbose in the next version, but that’s all I can do for now.

  13. 93
    jez Says:

    I get Error: Couldn’t update the post (DB error)
    on almost every second thing I want to “unlink”.

    besides, great plugin!

  14. 92
    Menghilangkan Broken Link di Blog Kita | WordPress [at] mimpikami . com Says:

    [...] plugin-nya Broken Link Checker, pekerja keras yang akan mengecek semua artikel blog kita dari tautan rusak dan gambar hilang, dan [...]

  15. 91
    White Shadow Says:

    All of the options are found under Options -> Link Checker (or Settings -> Link checker if you have WP 2.5).

    The “time period” option is on that same page and is called “Check Every Post Every [X] hours”. To get the strikethrough effect you need to enable the “Broken Link CSS” option, too (I think it should be on by default) and, if you have any caching plugins, make sure the cache is refreshed.

    That should do it :)

  16. 90
    NewMexiKen Says:

    175 and counting (but I have > 12,000 posts going back 4-1/2 years).

    I’m certain I’m just missing it, but I can’t find where I “can set a different time period.” Not that I want to, I just wondered.

    Also I don’t see the strike out, which is cool, documented. Am I just missing that too?

    Good work. Thanks.

  17. 89
    Carl Says:

    Great plugin. Found a bunch of false positives, all of which are links to wikipedia, but a couple other links that were actually broken. Well worth the trade off of occasionally getting a false positive.

  18. 88
    onews Says:

    I move my data to new host and lot of images links missing, thank to Broken Link Checker that solve my problem, thanks author for your great job.

  19. 87
    White Shadow Says:

    I guess there’s some kind of JavaScript conflict (Prototype vs JQuery). I’ll see if I can find it.

  20. 86
    shootingboard Says:

    Great plugin. One problem - when I activate it, the drag & drop feature of some of my other plugins (pageMash, FAQ-tastic) stop working. Any idea why?

  21. 85
    Scott Bradford: Off on a Tangent » Blog Archive » WordPress Plugin Role-Call Says:

    [...] Broken Link Checker—A perennial problem on my (and any other) site is that it has links to many other web sites, and those web sites change over time.  The Broken Link Checker scans all new posts (and periodically scans all old posts) and reports any broken links to me, giving me the opportunity to either remove or change those links so my readers don’t get 404 errors.  Very cool. [...]

  22. 84
    White Shadow Says:

    I think I made no changes to the wsblc_ajax.php file in the new version, so it shouldn’t be suddenly crashing now. The error message also doesn’t explain much. If it wasn’t linked to the update I’d suspect server configuration or some kind of incompatibility…

  23. 83
    Abi Says:

    Hi
    I am getting an internal error 500 since upgrading to the new version of broken links. It shows all over the palce in admin panel. I had no problems with plugin until recently it worked like a dream - see error below:

    [www.lets-makemoney.co.uk] [Sun Apr 13 18:19:04 2008] [error] [client 86.146.73.230] Premature end of script headers: wsblc_ajax.php, referer: http://www.lets-makemoney.co.uk/wordpress/wp-admin/options-general.php?page=broken-link-checker/broken-link-checker.php&updated=true

    I have had vaiorus problems wit the plugin dashboad too like plugins not auto updating on request and activating a plugin and going back to find it deactivated? I am using wp 2.5.

    Some strange behaviuor which from the sounds of this board otehrs have experienced too? Any ideas? thanks muchly :)

  24. 82
    The Best Blogging Software (WordPress) + The Top 60 WordPress Plugins | Midas Oracle .ORG Says:

    [...] Broken Link Checker 0.3.5 » Janis Elsts (url) Checks your posts for broken links and missing images and notifies you on the dashboard if any are found. [...]

  25. 81
    White Shadow Says:

    There is no hard-wired limit to how many links the page will display.

    Do you mean that it says somewhere that you have 26 broken links, but doesn’t display them on the “Broken Links” page (even after you refresh it)? I can’t think of any way that could happen.

    A few things that might provide some clues :

    * If you delete a post, all the broken links from that post will be gone, too (as you’d expect).

    * When you edit a post all of it’s links (even those that you didn’t change) are removed from the “Broken Link” list and re-checked as soon as possible. This may take a while if there are a lot of links to check.

    * Theoretically, in very rare circumstances, it is possible for the broken link table become desynchronized from the “posts” table. In this case, deactivate the plugin, activate it again and click “Recheck All Links” in the “Options -> Link Checker” page. This is pretty much the same thing as reinstalling the plugin, and should fix any discrepancies.

  26. 80
    Broken Link Checker: Gerencie problemas com links no seu blog | Open2Tech Says:

    [...] tome diversas ações a respeito. Trata-se do “Broken Link Checker“, desenvolvido pelo W-Shadow.com, o qual já está instalado e funcionando aqui no Open2Tech. [...]

  27. 79
    Candace Says:

    I had moved a lot of my photos in my gallery which my blog has about 100 links to, therefore I probably have about 100 broken links. However there seems to be a limit to how many you can see on the broken link page. After you have fixed those it doesn’t show the other broken links.

    So right now it says I have 26 broken links but my broken links page is blank. I did fixed 20 of them yesterday (it said there was 46 broken links then). I tried clearing cache and logging out but the page is still blank. So how do I fix the other 26 broken links?

  28. 78
    Sven’S Weblog » Blog Archive » Plugins Says:

    [...] Broken Link Checker [...]

  29. 77
    Matt Says:

    Truly excellent. A sincere thank-you.

  30. 76
    » chick, chick… Upgrade erfolgreich Says:

    [...] Broken Link Checker der im gesamten Blog auf defekte Links prüft, funktioniert leider noch nicht. Er lässt [...]

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

Leave a Reply