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.
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.
[…] 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.