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 :
[...] Found and removed all those broken/dead links thanks to Nile for mentioning this plugin. [...]
[...] 関係ないけど、Broken Link Checkerプラグインが切れてないリンクを デッドリンクとして認識しまくって困っている。 今日新しいバージョンが出ていたから更新したけど、改善されてるかなぁ? [...]
[...] http://w-shadow.com/blog/2007/08/05/broken-link-checker-for-wordpress/ [...]
[...] i kontrollpanelen. Broken Links Remover kollar alla länkar när besökaren går in på sidan, och Broken Link Checker gör igenom alla inlägg automatiskt med jämna mellanrum. Det är väl backend-skillnaderna vad [...]
[...] Si vous voulez diminuer votre taux de rebond et améliorer votre référencement, il est indispensable de contrôler les liens entre articles. Pour cela il suffit d’installer ce plugin : Broken Link Checker for WordPress [...]
[...] تقوم بهذا العمل في الووردبريس وهذه هي صفحة الإضافة Broken Link Checker [...]
[...] ・Post-Plugin Library – 上記二つを使うために必要なライブラリ。 ・Broken Link Checker – [...]
[...] Broken Link Checker – Проверява публикациите ви за невалидни линкове и [...]
[...] 違うんだ、あたしがやりたかったのは、昨日紹介したBroken Link Checkerの もっと精度のいいプラグインを入れたかっただけなんだ。 何もリダイレクトとかまでBad Linkと決めつけたかったんじゃないんだ。 くっ…。 [...]
any hints on how to show redirect-pages 302/303 as broken links?
$result['okay'] = (($code>=200) && ($code=200) && ($code<300)) || ($code == 401); is not working.
Off the top of my head :
This will treat all 3XX codes as indicating broken links. The RFC says those are all some form of redirect, so the code should do what you want.
Thanks a bunch!Works sweeeet!Thank you so much,great plugin,love your site!
Btw,do you know if this plugin consumes a lot of bandwidth when checking links?I need to check about 4500 links every 24 hours.Thanks in advance.
It tries to use only HEAD requests (when possible); that is, it asks the target server whether the page exists and doesn’t try to actually download it. This uses very little bandwidth. However, it will double-check each broken link and use more bandwidth for them.
Okay thanks,plugin works great
There seems to be some interaction between BLC and Twitter Tools. With BLC activated, there suddenly appears a stack of ‘function()’ lines in the hour and minute drop down in Twitter Tools.
Will also post this on Twitter Tools site.
Apart from that, the plugin worked like a dream.
I’ll look into it when I have time.
[...] Broken Link Checker 0.4.14 [...]
[...] Broken Link Checker [...]
[...] those of you who are WordPress users, I check using the Broken Link Checker plug-in (though don’t leave it on all the time as it slows things down too much, just run it every so [...]
I was looking for this plugin as I use Wordpress as a standard publishing tool for all my websites. After installing it, I will share my experience later.
[...] Broker Link Checker for Wordpress [...]
[...] existente Adresse beziehen. Also schaute ich mich ein wenig um und fand ein Plugin mit dem Namen Broken Link Checker. Kaum installiert und aktiviert, fing es schon an, seinen Dienst zu verrichten. Zwar gibt es einige [...]
[...] Broken Link Checker [...]
[...] Broken Link Checker After months or years since you write a certain blog post, some links which appear on it can change or, even worse, disappear, and that’s not good for your page rank. This plugin analyzes your posts and shows all the broken links, letting you easily fix them. Very useful. [...]
Broken Link Checker worked fine for a few month. But now, I have some errors. When I run “Re-check all pages”, all the website is in error (error 500) and many good links which point to my website are marked as broken :
Log : === First try : 500 ===
HTTP/1.1 500 Internal Server Error
Date: Fri, 20 Mar 2009 08:07:21 GMT
Server: Apache/2.2.X (OVH)
X-Powered-By: PHP/4.4.9
Expires: Wed, 11 Jan 1984 05:00:00 GMT
Cache-Control: no-cache, must-revalidate, max-age=0
Pragma: no-cache
Last-Modified: Fri, 20 Mar 2009 08:07:21 GMT
Vary: Accept-Encoding
Connection: close
Content-Type: text/html; charset=utf-8
Trying a second time with different settings…
=== Second try : 500 ===
HTTP/1.1 500 Internal Server Error
Date: Fri, 20 Mar 2009 08:07:21 GMT
Server: Apache/2.2.X (OVH)
X-Powered-By: PHP/4.4.9
Expires: Wed, 11 Jan 1984 05:00:00 GMT
Cache-Control: no-cache, must-revalidate, max-age=0
Pragma: no-cache
Last-Modified: Fri, 20 Mar 2009 08:07:21 GMT
Vary: Accept-Encoding
Connection: close
Transfer-Encoding: chunked
Content-Type: text/html; charset=utf-8
Link is broken.
Why the whole website is out when the plugin is checking all links ?
WP 2.7.1 (Akismet 2.2.3, akWpLightbox 1.0.0, All in One SEO Pack 1.4.7.4, Broken Link Checker 0.4.14, cforms 9.1, Exec-PHP 4.9, FeedBurner FeedSmith 2.3.1, FeedWordPress 2008.1214, Google Analytics for WordPress 2.9, Google XML Sitemaps 3.1.2, MobilePress 1.0.3, Remove Generator Meta Tag 1.0, WordPress.com Stats 1.3.7, Wordpress.com Stats Helper 0.5.5.3, Wordpress Newsletter subscription Opt-in for SendBlaster 1.1.6, WordPress Related Posts 1.0).
Ah, the mysterious “500 Internal Server Error”. That’s one of the most abused HTTP codes that can mean any number of things. Have you recently installed any security-related stuff on your server (e.g. new Apache modules)? The plugins look fine, but it could be caused by something else that works on webserver level.
Quite difficult to know what has been updated on the web server… It’s a shared hosting ! I will open a case next week to try to have more information or log file.
I will try if this issue is related to the last version of the plugin (try version 0.4.13).
Thanks for your reply !
I have the same issue with version 0.4.13. I have open an incident to have more informations from my hosting provider. It seems my database is limited to up to 3 concurrent access. Any idea ?
Thanks.
That sounds very restrictive, though I have to admit I don’t know much about this aspect of databases. No ideas, sorry.