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 -
- Download (see below).
- Unzip.
- Upload the broken-link-checker folder to you wp-content/plugins directory.
- Activate the plugin in the Plugins tab.
Upgrading
- Deactivate the plugin (important!).
- Do steps 1.-3. from “Installation”.
- Upload the broken-link-checker folder to you wp-content/plugins directory.
- Re-activate the plugin in the Plugins tab.
Download
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.
Related posts :
I am using it, but since I activated WP-SuperCache it throws an Internal Server Error (every second). It looks like the settings for this plugin (.htaccess changed) are interferring the work of your plugin. Could this be and how could I solve this?
Cheers
Sebari
@ sebari : That’s interesting. I’m using WP-SuperCache 0.8.8 myself and I haven’t encountered any problems. In fact, I can’t immediately think of any possible way these plugins could conflict. You might have better luck reporting this issue to the author of WP-SuperCache.
[...] by signing up with google and using their web tools to check, download the plugin for wordpress Broken Link Checker, use this site dead-links, or you can do it the hard way and just click every link on your [...]
[...] Descargar [...]
I always get a broken link message for the following link:
http://www.panasonic.de/html/de_DE/2036940/index.html
but everytime I’m testing the link there are no problems.
Andreas
@ Andreas : Click the “Details” link in the report, there might be some clues there. Other than that, all I can suggest is adding the link to the exclusion list.
@ White Shadow : “Details” says:
1. Log : === First try : No response. ===
Trying a second time with different settings…
=== Second try : No response. ===
Link is broken.
Hmm, this would usually be a temporary error. The plugin tried to access the link and got no response from the target server – not even an error message. This might happen (very occasionally) if the server was overloaded, but if the problem reoccurs then the target server might be actually blocking the plugin, or similar.
Then the server must block the plugin as it happens with every link to this server and always.
I’ll put the server on the exclusion list.
Thanks, Andreas
can you make plugin to check rapidshare, depositfiles … if links are alive or dead
@ Matrix : Probably not. That would needlessly complicate the plugin.
[...] who gladly contribute plugins and one of those plugins that currently serves me very well is the Broken Link Checker plugin. It scours your posts and pages for links that do not lead to working pages anymore i.e. [...]
Very nice plugin, I found a bunch of broken links on my blog! o.O;;;
Great plugin!Im allready in love with it!Im testing if it also works on videolinks like megavideo etc.Hope it works cause then i will be using it a lot.So far so good,keep up the good work!
[...] Broken Link Checker: Comprova a les teves entrades si hi ha enllaços trencats o imatges que falten i t’informa al Tauler si en troba alguna. [...]
How can i get the links with redirects to be displayed as broken links.
is it just a case of changing
$result['okay'] = (($code>=200) && ($code=200) && ($code<300)) || ($code == 401);
Thanks
Craig
Code looks like its working all 302 / 301 redirects are now displayed as broken links, so i can clean them up now
Thanks for the great plugin
Craig
That feature has in fact been suggested before, but I’ve put it off due to lazyness
Glad you got it working for you.
Loads of my posts with images are showing up as broken links, even though they work fine when you look at the post. Any ideas?
Hmm. Are the images hosted on your site or somewhere else? What do the “Details” reports say?
There are some missing, which is odd, but most of them are 404 errors, but when I view the post they are there. I do have image hotlinking protection turned on in my .htaccess file, maybe thats the problem? They are on the same domain, so I don’t think that should be a problem, but maybe it is?
Yes, hotlinking protection could cause this problem. I don’t know your particular setup, but if the protection works by detecting visits without a referer header, it would block the plugin.
Yes its using the referer, any way around it?
I’ll upload a minor update that should fix it.
Now this is why I love the Wordpress community! You can’t beat support like this. Thank you very much!
[...] WORDPRESS PLUGINS (That are not listed in everyone else’s Essential Plugins List!) Broken Link Checker (Examines entire site for broken links) Referrer Detector (Greets visitors from other sites) Thesis [...]
What does this mean lol???? I just want to detect broken youtube videos. Hard to test, so not sure if this plugin will work for it. . . .
”
Hello, Yeah, as the plugin “Broken Links”, but than report videos of youtube deleted or removed, inserted for Embed direct in wordpress, as:
==============
==============
So bloggers we can always know when a video has been removed, and can us update it.
maybe rename to “Yotube Broken Links” or “Youtube Broken Embed”,
Well, Thanks! for “Broken Links”, is a exelent plugin!
Good Luck!.
Sorry for my english, I don´t speak english. =/
“
@dave : You can’t do that with this plugin. First, an embedded video is not a link and requires custom parsing to recognize it. Second, when you try to access/view a removed YouTube video, YT doesn’t send the standard “404 Not Found” error reply, but sends a redirect instead. In the current implementation the plugin treats redirects as working links.
@white shadow: thanks for the quick reply. The comment I quoted does seem to imply that this plugin CAN do that, so thanks for the clarification. Hmm, I guess the only way I’ll be able to add this is to have a link on each page called ‘report broken video’ or something similar.
Anyone got any good ideas for how to add this in, without writing some kind of custom email script? I just want to allow a user to click a button, and somehow I get notified that the video my post links to has been taken down.
Cheers!
You could use one of the contact form plugins and include a link to the contact page below each video. Personally, I use Contact Form 7, but there are also other alternatives available.