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! (423 KB)
Features
- Detects links that don’t work and missing images.
- Periodically checks links in posts, pages, comments 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.
Installation
Install “Broken Link Checker” just like any other WordPress plugin :
- Download the .zip file.
- Unzip.
- Upload the
broken-link-checkerfolder to you/wp-content/pluginsdirectory. - Activate the plugin in the Plugins tab.
Download
broken-link-checker.zip (423 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.
Related posts :
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
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
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.
[...] 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 [...]
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 …
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
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
Does it works on WordPress 2.3.2?
thanks…
Yes, it does. In fact, I just upgraded to 2.3.3 and it seems to be working okay.
[...] 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 [...]
[...] 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. [...]
[...] 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 [...]
[...] 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 [...]
[...] WordPress Plugin Broken Links, welches ich vor ein paar Tagen aufgenommen habe, ist ein unverzichtbarer Link Checker. Dieses [...]
[...] 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 [...]
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. =)
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.
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
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
@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
Strange, it was working fine with older plugin version… then I updated to 0.3.2 today. Then it falsely reported 132 broken links. I checked all of of them and none of them were broken.
Even weirder, after activating the plugin, my WordPress Dashboard started loading very slowly, so I deactivated the plugin then “tried” to activate again and now I can’t activate at all… because I now keep getting this message:
“Plugin could not be activated because it triggered a fatal error.”
But now my WordPress Dashboard (2.3.3) is loading fine and fast. Hmm.
Strange. I suppose it could cause a slowdown in very specific circumstances (AJAX/broser/server configuration) while the links are checked.
Though I don’t see how it could “trigger a fatal error”. Hmm.
I updated to 0.3.2 and suddenly every link on my site became “broken” according to the plugin, but when I tried them, they all worked perfectly.
Nothing else changed apart from this update. The previous version worked perfectly.
Seems you’re not the only one to experience this. I’ll download 0.3.1 and 0.3.0 from the WP plugin database (there’s a link for “Other versions”) and try to find which change might have caused it.
On a related note, it seems that this plugin is now getting blocked by Bad Behaviour. Maybe that’s at least part of the problem?….