Broken Link Checker for WordPress
Notice: This plugin has been transferred to ManageWP. I am no longer working on it. Please direct any feedback to the new developer. See the plugin homepage for more information.
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.
Features
- Detects links that don’t work, missing images, deleted YouTube videos and other problems.
- Periodically checks links in posts, pages, comments, custom fields and the blogroll.
- New and modified entries are checked ASAP.
- Notifies you on the Dashboard if any problems are found.
- Lets you edit all instances of a specific link at once.
- Gives you a list of all links ever posted on your site, with the ability to search and filter it.
- Lets you apply custom CSS styles to broken and removed links.
- Highly configurable.
The broken links show up in the Tools -> Broken Links tab along. If any invalid URLs are found a notification will also show up on the Dashboard widget. To save screen real-estate, the widget can be configured to stay closed most of the time and automatically expand when broken links are detected.
Download
broken-link-checker.zip (412 KB)
Requirements
- WordPress 3.0 or later
- MySQL 4.1 or later
The current version of this plugin is only compatible with WordPress 3.0 and up. If you have an older version of WP, try one of the older releases. Specifically, version 0.8.1 is the last one that’s still compatible with the WP 2.8 branch, and version 0.4.14 is the last one compatible with WP 2.1 – 2.6.x.
Installation
Install “Broken Link Checker” just like any other WordPress plugin :
- Download the .zip file (see below).
- Unzip.
- Upload the
broken-link-checker
folder to you/wp-content/plugins
directory. - Activate the plugin in the Plugins tab.
This is my first post
just saying HI
[…] Broken Link Checker Checks your posts for non-working links and lets you know (on the dashboard) if any are found. It’s of the “set and forget” kind, as it does the checks in background. Sometimes generates “false alerts”, probably because no site is up 100% of the time. And yes, this is one of my creations […]
thx!! i’m going to try it
[…] Broken Link Checker WordPress plugin has been updated to version 0.2! Here’s what’s new […]
[…] you could also launch the script from the client side by using AJAX. This is what I do in my link checker plugin for WordPress. Another possibility is to store the tasks that need to be done in a database […]
WordPress database error: [Unknown column ‘hidden’ in ‘where clause’]
SELECT count(*) FROM wp_blc_linkdata WHERE broken=1 AND hidden=0
No broken links found
WordPress database error: [Unknown column ‘a.hidden’ in ‘where clause’]
SELECT b.post_title, a.* FROM wp_blc_linkdata a, wp_posts b WHERE a.post_id=b.id AND a.broken=1 AND a.hidden=0 ORDER BY a.last_check DESC
tony : Try deactivating the plugin and activating it again.
I’m not sure if my previous message made it through, but I cannot get your latest, 0.2.2, version to work on my WP 2.3 installation. I can configure the settings, and the database does get your two tables, but it never actually checks the links. I’ve activated and deactivated and I have the same problem.
Peace,
Gene
I responded to your first comment here.
[…] In WordPress? Our secret weapon to maintain our outgoing links in wordpress will be using this Broken Links WordPress Plugin. This plugin allow you to set an option to check all your links within X hours and report back to […]
Thanks for creating this plug-in – after installing WordPress I simply couldn’t understand why such a basic maintenance function is not included in the base package. Fortunately I stumbled upon your plug-in.
I upgraded to version 0.2.3 this morning but unfortunately it behaves just as erratically as the previous release – showing numerous (103 right now) and always changing ‘broken links’ that work just fine.
I cannot find any sensible explanation except that the plug-in might use time-outs to determine if a link is not there and that my site doesn’t respond fast enough. Could this be the case?
Yes, it does use timeouts – it has to set some limits so that the server isn’t overwhelmed by dozens of processes waiting for a page that might or might not load.
Currently the timeouts can only be changed by editing the plugin files. If you want to do this, look in the file wsblc_ajax.php, lines 229 – 230 (they contain the word “timeout”). The first number is the connection timeout (default = 15 seconds), the second is an “overall” timeout (default = 25 seconds). You can try setting higher timeouts.
If you give me a few examples of links that are reported as broken and yet work fine, I’ll try to find out what the problem is.
BTW, the list of broken links is always changing because existing links are re-checked every once in a while, plus links that are reported as broken are being rechecked several times to (hopefully) get rid of most false positives.
Eh, bugs :/
http://www.prepressure.com/postscript/troubleshooting/errors
There are loads of ‘missing links’ on this page but I am fairly certain the page is OK
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!
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 🙂
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.
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.
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” 😛
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.
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 😉