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! (40 KB)

Note : This page, and the feature list below are slightly out of date as a major update has been released recently (see details). I’ll get around to updating this page eventually.

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.5.3 : broken-link-checker.zip (40 Kb)

Requirements

  • WordPress 2.7 or later
  • MySQL 4.1 or later

Starting with version 0.5 this plugin is only compatible with WordPress 2.7 and up. Older versions (e.g. ver. 0.4.14) should work with WP 2.1 – 2.6.x.

Share :
  • Reddit
  • del.icio.us
  • Digg
  • StumbleUpon
  • DZone
  • Ping.fm
  • Sphinn
  • Twitter
Related posts :

1,077 Responses to “Broken Link Checker for WordPress”

Pages: « 116 17 18 19 20 [21] 22 23 24 25 2636 » Show All

  1. 598
    White Shadow says:

    Which version was that? I’m asking so I can compare the relevant code and (hopefully) see why it doesn’t work in the newer version. Also, could you give me an example URL (or two) that isn’t reported correctly? It might help with the debugging.

  2. [...] Web: w-shadow.com/blog/2007/08/05/broken-link-checker-for-wordpress [...]

  3. [...] Broken Link Checker for WordPress – As your blog gets more and more posts, it can be difficult to go back and look for what has broken with time.  This plugin will check images and links and notify you via the dashboard when it locates something. [...]

  4. 601
    Allstar says:

    The version that is working is 0.4.13 running on wordpress 2.8, example url: http://www.megavideo.com/?v=UJHYX7FE

    I also use your latest version of the plugin on another site running 2.7.1 and it works great,but the older version wont work on that site :-|

  5. 602
    paul says:

    hello thanks for this plugin has come along way since i first sen it one thing if you can tell me where in the code i can change the timeout value as some of the sites i use/link to can load slow at times therefor they be reported as broken links

    thanks

  6. 603
    White Shadow says:

    @Allstar : Looks like this is a bug in the linked site and possibly cURL. The the example URL returns a misnamed field in the HTTP response header (“location” instead of “Location”) and apparently this causes some kind of glitch in your version of cURL.

    Well at least that’s what I think. Here’s a test : put a link to http://w-shadow.com/redirect302.php in one of your posts (this is simply a one-line PHP script that does a well-formed 302 redirect to my homepage. You can use an old post and remove the link later). If my idea above was right, this link should be detected correctly by the plugin.

    @ paul : The timeouts are set in the link-classes.php file.

    If you have cURL, change the lines 159-160 :

    curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 20); //connection timeout (in seconds)
    curl_setopt($ch, CURLOPT_TIMEOUT, 30); //overall timeout (in seconds)

    If not, change line 222 :

    $snoopy->read_timeout = 60; //read timeout (in seconds)
  7. 604
    Ian Glendinning says:

    I have a longstanding blog with many broken links.
    Finding them is one thing … do you have a global search and replace utility that works on my WordPress SQL database to fix any that I condsider fixable ?

  8. 605
    White Shadow says:

    You can change a link via the plugin’s interface. On the broken link list, hover your mouse over the link’s URL and click the “Edit” thing that will show up. Then input the new URL and click “Save”. This will replace the old URL with the new one in all posts and pages where it’s used.

    Also, check out the Search and Replace plugin.

  9. 606
    Ian Glendinning says:

    Wow, many thanks.
    That’s the power I am looking for … I shall be trying out this plug in and contributing if it works :-)

  10. 607
    Ian Glendinning says:

    Double wow – that global S&R will be very useful too … I have repeatedly mistyped names and terms over the years and that will ease my housekeeping.

  11. [...] Broken link checker: Este plugin revisa os links externos do nosso blog e comprova que estes links estão ativos ainda ou não. Muito útil para artigos antigos. [...]

  12. 609
    Jacob Share says:

    When I activate the plugin on a test blog with only a few articles (v0.5.3), it works like a charm. When I activate it on my main blog with over 300 articles and thousands of links, it takes a few minutes to get going and the site isn’t responsive during that time.

    Any way to improve performance and making the install/upgrade play more nicely in the background?

  13. [...] engorro tratar de localizarlos uno a uno y ver por qué están fallando. Sin embargo, con el plugin Broken Link Checker for WordPress (que ya tiene un par de años, pero desconocía), esta labor es coser y cantar. El programa sondea [...]

  14. 611
    White Shadow says:

    @ Jacob : Sorry, I can’t think of anything useful at the moment. Maybe your server is just slow? It might be possible to make introduce some kind of staggered update algorithm, but that wouldn’t make much sense for the initial install because most users probably want the plugin to be up and going as fast as possible.

  15. 612
    Gabriella says:

    Hi! The plugin is nice, but I decided to delete it from one of my blogs because the plugin does uses too many memory and the uninstall process simply brought me to a blank page, and nothing was deleted :(
    At first look, it seems that you are using the right code, but who knows. I’m using WP 2.8.1.
    Any fix necessary?

  16. 613
    White Shadow says:

    I’m not sure what I can do about the memory usage, but I’ll fix the uninstaller right away (found the bug).

  17. [...] Broken Link Checker for WordPress: muy completo. Rastreo programable. Opciones avanzadas como la de cambiar el estilo de los enlaces rotos, por ejemplo tachándolos. [...]

  18. [...] 2. Broken Link Checker Handy to have onboard and exactly what it sounds like, Broken Link Checker automatically sweeps posts for any links that either were broken to begin with or have ceased functioning in the time between their initial posting and the present. The results of each sweep are displayed in simple and clear display in the dashboard. A simple piece of great utility that can be employed in any blog but is particularly useful to those who frequently or by default use their blogs as connecting ports to show other developments on the web. [...]

  19. White Shadow, thank you for your time.

    Can you think of reasons why I seem to be getting a lot of false broken links? I think this has been going on since upgrading WP to 2.8 (now at 2.8.2 and latest plugin). They show up as broken links, but when I expand them they show something similar to:

    # Link last checked : July 20, 2009
    # HTTP code : 0
    # Response time : 0.000 seconds
    # Final URL :
    # Redirect count : 0
    # Instance count : 1

    What other info would you need? Thank you for your time.

  20. 617
    White Shadow says:

    Links that are currently being checked may be incorrectly reported as broken. However, those false positives should go away in a few minutes, tops.

    Another possibility is that the plugin starts checking a link (the link record is “half-updated” immediately due to complicated reasons) and the link URL takes a long time to respond, causing the checking script to be terminated for exceeding the maximum allowed execution time. I’ve never seen this happen myself, but it’s theoretically possible on servers that have the max execution time set low and don’t allow scripts to change it.

    Or it could just be a legitimate link timeout. Network glitches/server overloads do happen. In this case the false positives should go away in a few hours.

    If you don’t think the above ideas explain the issue, post a few example URLs that are (consistently and incorrectly) detected as broken. I’ll see if I can find out why.

  21. [...] Broken Link Checker – monitors and notifies you for broken links on your blog. [...]

  22. [...] Broken Link Checker is really handy.  It goes through your site and looks for broken links – then displays a nice dashboard widget telling you how many unique links you have in your site, and how many of them don’t work.  Since the web is everchanging, a site that is up today may be gone tomorrow – it’s handy to know so that you can easily remove broken links without having to test them all yourself. [...]

  23. [...] de buscar durante varios días enlaces rotos en el blog a través de sus cuatro años de existencia he observado mi reflejo en cada palabra como [...]

  24. [...] de buscar durante varios días enlaces rotos en el blog a través de sus cuatro años de existencia he observado mi reflejo en cada palabra como [...]

  25. 622
    Larry says:

    Just like Dan I’m getting 12 false broken links on a regular basis. When I recheck all pages the list clears, but then later the same 12 show up again. Here are three.

    http://www.resourcesystemsconsulting.com/blog/wp-content/uploads/John D_ C_ Little.gif

    http://www.resourcesystemsconsulting.com/blog/wp-content/uploads/Mentors Guide.jpg

    http://www.resourcesystemsconsulting.com/blog/wp-content/uploads/warehouse 2.jpg

  26. [...] with by the webmaster to inform visitors that the links are not working. The Broken Link Checker plugin is an excellent way of finding and removing broken links from a Wordpress [...]

  27. [...] Follow this link: ø Broken Link Checker for WordPress | W-Shadow.com ø [...]

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

  29. [...] ø Broken Link Checker for WordPress | W-Shadow.com ø (tags: wordpress plugins plugin tools broken links) [...]

  30. 627
    Jon Hassall says:

    Works great for me. Sometimes it detects a false positive first time, but next time it corrects the problem which is good.

Pages: « 116 17 18 19 20 [21] 22 23 24 25 2636 » Show All

Leave a Reply