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.
[…] http://w-shadow.com/blog/2007/08/05/broken-link-checker-for-wordpress/ […]
Never had problems until 0.9.3, but now:
Failed to create table ‘XXXXX_blc_filters’. Database error: Unknown character set: ‘utf’
and
Fatal error: Cannot redeclare blc_init_containers() (previously declared in /is/htdocs/XXXXX/wp-content/plugins/broken-link-checker/broken-link-checker.php:147) in /is/htdocs/XXXXX/wp-content/plugins/broken-link-checker/broken-link-checker.php on line 172
Is there, perhaps, a DB_CHARSET definition in your wp-config.php? In the new version, the plugin uses the same database character set as is configured for WP itself, and that is always “utf8” (not “utf”) – unless overridden by a wp-config.php directive or another plugin.
Had no problems. Upgraded WordPress to version 3 and now if I try to create a new page, I can’t do it. If I disable Broken link checker everything is OK again. No problem with posts. My site uses PHP 4 . Broken link checker 0.9.4.2.
Try this version.
I’ll probably drop PHP4 support soon; it’s just too much headache both for me (fixing all the damn incompatibilities) and the users (getting frustrated by “broken” updates that work perfectly well in PHP5).
@ 1138
I am a german azubi, thats why in my wp-config.php is an “utf-8”. Don´t ask me why, but this is a part of the german standard installation. I changed it into “utf8” and the installation of BLC works perfect, but with “utf8” there are a lot of problems in the blog with german chars (Umlaute). I changed it back to “utf-8” and it is fine again, both BLC (because the installation was done) and german chars. It would be nice, if next versions of BLC could work with this “utf-8” too. Thank You!
I see. I’ll add a workaround for that situation in the next version.
[…] Broken Link Checker – monitors and notifies you for broken links on your blog. […]
Great plugin, however I can’t get it to scan my Custom Post Types. I have most of my content in these Custom Post Types, and the BLC only checks WP standard posts. Custom Fields option doesn’t seem to help. Is it possible?
Not right now, no. This is something I’m planning to add in a future release.
All https:// links are shown to be broken. I am using a Ubuntu 8.04 server, the package ca-certificates providing ssl certificates is installed. Is there any way to get the plugin working with ssl links?
[…] Broken Link Checker (Janis Elsts): A great way to audit the links on your web site to ensure they continue to direct visitors to viable pages. […]
The plugin deliberately skips certificate verification, so what certificates you have installed shouldn’t matter. It also usually works fine with HTTPS links. Can you give me a few examples that give it trouble?
Here are some of the links that are not working for me:
https://launchpad.net/~phylu/+archive/usplash-theme-fingerprint
https://dl-ssl.google.com/gears/0.5.32.0/gears-linux-opt.xpi
https://www.dropbox.com/votebox/
https://launchpad.net/~phylu
G’day!
Thanks for a great plugin – it’s helped me so very much 🙂 I’ve got a weird thing going on with this plugin in a single one of my 3.0 websites though, there’s a persistent admin message saying there’s a problem:
I’m not sure if this means there’s an error creating the search filter table or what – it’s sorta obscure! I’ve checked the plugins page and it says the plugin in active. Do you want me to check anything in the database or do some other debugging? Thanks ever so much 🙂
@ Phylu :
Strange, they all get checked properly on my test site.
Is the plugin using CURL or the Snoopy library? You can determine that by looking at the “Details” log of any link that’s already been checked. If it’s using Snoopy, it will say so at the bottom of the log.
@ Ricky :
Yes, that probably means something went wrong when it tried to create that table.
Technically the plugin is supposed to output an explanatory error message if that happens. Considering that it didn’t (the log just ends abruptly), I can only assume that it somehow managed to crash in a way that’s supposed to be impossible. Wonderful 🙂
Have you tried deactivating and reactivating it? Is there anything on the Tools -> Broken Links page?
You could also try to manually run the query it uses to create that table and see what happens (i.e. any errors or such) :
(No, the wp_ table prefix is not actually hard-coded. When that query is run by the plugin, it detects the right prefix automatically.)
It has been usig Snoopy.
I tried to install php5-curl, but nevertheless Snoopy will be used without any success for https links.
Ah, that answers why your links don’t get checked properly : Snoopy doesn’t support the HTTPS protocol.
As for curl, your installation probably wasn’t set up right. If curl functions are available, the plugin will use them. It’s very easy to check if curl support has been installed properly – just put this short script in a new PHP file and load it in your browser :
Thanks a lot. Perhaps you could put this need of curl for https links in the readme.txt or somwehere else, easy to find.
After the curl installation i forgot to reload the apache configuration. So it works now.
Best regards!
Once I deactivated and reactivated it, t’was fine. I’ll chalk it up to the heisenberg effect or something 🙂 Thank you!