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 :
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?
[...] Broken Link Checker – A plugin for WordPress that checks your posts for broken links, and lets you know if any are found. [...]
The plugin was supposed to already understand relative URLs, but it appears I forgot to fully implement that feature. It should work better in the new version I’ve just uploaded to wordpress.org (0.5.6).
That is really a very useful tool, thanks.
Excelente plugin… ya lo he usado en varios sitios y funciona de maravilla, he logrado corregir una gran cantidad de vínculos rotos!
Saludos cordiales
I just wrote a review of your great plugin on my blog: http://www.word-ex-press.com/an-useful-plugin-broken-link-checker/.
Thanks for your job!
[...] können diese mit einem Klick entfernt werden. Das Plugin nennt sich Broken Link Checker von W-Shadow und prüft erstellte Artikel, Seiten und die Blogroll nach toten Links. Selbstverständlich [...]
[...] Scans your post for non-working links. This keeps you from looking dumb when people come to your site from search engine and find bad links.by W-Shadow. [...]
Addition to your answer with id: 657
I updated to thew new version and most oft my “broken links” did disappear. I fixed the other ones manually.
But one thing which still does not work. If the relative link starts with “../” or “../../” etc. the link is reported to be broken.
Specific examples would be nice. It’s supposed to handle URLs like that, so I need to see a more specific situation where it fails to find the bug.