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 :
[...] ø Broken Link Checker for WordPress | W-Shadow.com ø (tags: wordpress plugins plugin tools broken links) [...]
Works great for me. Sometimes it detects a false positive first time, but next time it corrects the problem which is good.
OMG! this is what i want! i had use it on my site… awesome!
thanks for sharing it
[...] Broken Link Checker Wenn sehr viele Blog-Posts vorhanden sind, ist das Prüfen von Links im Blog so gut wie unmöglich. Mit dem Tool Broken Link Checker können fehlerhafte Links aufgespürt werden. [...]
Hello,
Thank you for this great plugin! I just installed it, ran it and am already loving it!
I have a feature request, though: add an option “Use archive.org’s version” (or whatever shorter form to say it). I think you’ll see the use of it: a frozen link is better than a dead link. When archive.org has several links, choose the latest version.
Two possible enhancements:
- when multiple links are available, choose the one closer *in the past* to the post’s timestamp (avoid links in the future of the post)
- automation: well, this is pretty much self-explanatory
All of this take its toll on the server and archive.org’s server (my blog is 3000 post and 9000 comments wide), so some sort of load balancing could be necessary.
Thanks again!
Oh, by the way, two more things:
- first, I noticed there ate 631 comments (with this one). It means you won’t read this. I have to find another way to send feature requests
- second, another feature request: when a link appears several times (complet link, that is, with identical up to the nternal anchor included), to have the possibility of changing it everywhere. In understand this goes beyon checking (it is not reading anymore — it is writing)
[...] manualmente tutti i link, specialmente se si hanno tanti articoli e file caricati, ma per fortuna Broken Link Checker ci viene in [...]
@David : I read all comments; I get a notification email for each one
It just sometimes takes a while for me to respond.
Anyway, I’ve added your suggestion about archive.org to my To-Do list. You can expect it implemented sometime in August, I think. As for changing a link everywhere, the plugin already does that – if you edit a link via the plugin’s interface, all links that have the same URL will be changed in all of your posts and pages (and the blogroll).
@Larry : Sorry for the delay, I’ll get around to checking those links soon.
archive.org idea sounds awesome. Thanks
After a couple of weeks in use this plug works like a dream – EXCEPT – it has some unexpected “features”. It clearly doesn’t like links with spaces in them and marks them as broken even if they are not. And when you ask it to ignore them it does so for one checking cycle … but marks them as bad again next time round. (Same as Larry says above)
This either needs a fix or more configurability of rules ?
And I have to agree the “archive.org” idea sounds very interesting.
Allright, URLs with spaces should be handled properly in the latest version (0.5.5). Note that it may take up to 12 hours before you get the update notification on your dashboard.
Works great, thank you
@White Shadow: wow, that is a very good surprise! Honestly, if quarter a blog I post in had such a good support… well I’d be pleased
And the batch-rename thing too is a good surprise.
I seriously consider adding this plugin to my must-have list for every WordPress blog!
Why, thank you
Question: does the plugin automatically strikes-through dead links or is it a bug with the theme I am using now (I am using K2 and I think I noticed this annoyance before ever installing the link checker)?
That is a feature. You can turn it off in the plugin’s settings – either uncheck the “Apply class=”broken_link” to broken links” checkbox or edit the relevant CSS in the textbox below that.
Question again:
- how to “unexclude” accidentally excluded links?
- out of editing my SQL dump with regexp, what is the best way to massively rename links? For instance, I want to change http://david.latapie.name/tag/ to http://david.latapie.name/blog/?tag= (I moved from one blog system to WordPress and most of my links are now dead)
Oops, now without brackets:
h**p://david.latapie.name/tag/something to h**p://david.latapie.name/blog/?tag=something
By the way, a preview function would be great.
The excluded links/keywords are also listed on the settings page, in another textbox. Just delete the unnecessary ones.
As for your second question, check out the Search And Replace plugin.
You deserve some (more) publicity.
Thanks, White Shadow. I had to reopen the page on another tab, because it did not finished checking yet.
Just for fun:
Found 1614 broken links
7467 URLs in the work queue
Detected 11312 unique URLs in 13210 links.
And counting, I guess
If you ever need a something huge blog for bugtesting, a dump of mine will be available on request
Thanks WS. I’ll look out for the update, and drop in a paypal donation.
[...] of nifty WordPress plugins in combination to help me to compile a huge list (Top Commentators and Broken Link Checker) along with some good old fashioned manual labour for checking quality. Doing this lengthy exercise [...]
[...] Broken Link Checker [...]
[...] Broken Link Checker (v. 0.5.2) by Janis Elsts. [...]
[...] morning I came across a Broken Links Checker plugin for Wordpress while looking to see why my tag cloud disappeared when I updated it [...]
Very nce, thank u….
[...] Broken Link Checker リンク切れチェッカー。 データを移転しているので、どこかで切れてるかも~って思って導入。 20個ぐらいのリンク切れを一気に直しちゃいましたよ~。 [...]
Thanks for this very helpful plugin.
But there is one thing wrong when cheking pages: The plugin is unable to understand relativ links.
An example:
http://www.etes.de/informieren/unternehmen/ links to http://www.etes.de/informieren/unternehmen/systemhaus/. The href is just “systemhaus” because it is a subpage.
Is it possible to implement that? Do you need further informations from me?