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! (423 KB)
Features
- Detects links that don’t work and missing images.
- Periodically checks links in posts, pages, comments 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.
Installation
Install “Broken Link Checker” just like any other WordPress plugin :
- Download the .zip file.
- Unzip.
- Upload the
broken-link-checkerfolder to you/wp-content/pluginsdirectory. - Activate the plugin in the Plugins tab.
Download
broken-link-checker.zip (423 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.
Related posts :
@CID – “shorthand” URLs shouldn’t be a problem if the URL is otherwise valid and working. In particular, external links should always include the protocol part (usually http://).
Are the local links using relative URLs? The plugin should handle it, but the algorithm is not perfect.
~ bug ~
When I activate the plug-in my website bleeds through the admin. So I can actually see my website below with some themes the admin, and integrated with the admin in other themes.
~ end bug ~
has this been fixed yet?
When I search for “broken link checker” in the wordpress plugins search I do not see your plugin any more. What happened?
http://wordpress.org/extend/plugins/search.php?q=broken+link+checker
@Bart Gibby – The WordPress.org plugin search is notoriously bad. The plugin page is still up.
As for the “bug”, check that wsblc_ajax.php is present in the plugin’s folder (i.e. in wp-content/plugins/broken-link-checker/) and that it doesn’t have any weird permissions set. Actually, just see if you can access yourblog.com/wp-content/plugins/broken-link-checker/wsblc_ajax.php. You might have a .htaccess rule or some security module blocking it. Or possibly your “wp-content” folder isn’t where the plugin expects it to be.
Broken Link Checker is not compatible with Ozh Better Feed
@cartmanffc – Okay, thanks for the info.
If i’am klick on ‘unlink’ in the list of Broken Links, The complete text of the Artikel is deleted!
I’am working with the newest Version of WordPress 2.6.2!
@Stefan – Err, sorry? That has never happened in my tests :/ If you have backups (hopefully you do) could you mail me the post (including HTML etc, not just the text) that got deleted? My email is whiteshadow (et) w-shadow (dott) com
I would run some tests with that posts and try to find the cause of the problem.
Love the plugin — it works so much better than any other link checker I’ve tried! Sadly, I had to turn it off after upgrading WP because of server load problems (I’ll keep an eye out for updates that address this issue!).
@alice – Thanks
I haven’t been able to pinpoint the source of the performance issues yet as only certain people/blogs seem to have them. The plugin has always been running well on my sites.
White Shadow,
I’ve been thinking about the server load problem and how only a few people seem to have run into the issue. In trying to come up with reasons I might have had the problem where others didn’t, I came up with two possibilities:
1) my blog goes back to July, 2004, so there are a lot of entries with an abundance of links, which could have kept the link checker pretty busy; and
2) and this one is probably the more important one: I tend to just leave my dashboard open in a browser tab all the time. Since your plugin is designed to work certain intervals whenever the dashboard is open, that means that I’m letting it work around the clock. Maybe there needs to be a setting to slow down the link checker if the dashboard is left open for long periods of time?
Anyway, maybe this info might be of some use to you.
Have a great weekend,
Alice
@alice – So is the slowdown you experience really occuring on the server, or just in the browser? If you try to access the site from a different computer when you have the dashboard open on another, does it still load more slowly than usual on the other computer? That would help narrow down the range of possibilities.
I don’t know if this would help, but here’s an idea – go to the plugin’s settings and increase the “Check every post” value to ~160 hours. Also increase “work session length” to 60-120 seconds. It might reduce the load, or it could make it worse, or do nothing, but it would be an interesting data point.
what difference of this and google webmaster tools ?!
thanks for share this plugin.
@mobile software – Google Webmaster Tools lets you know about internal broken links, for example, when a link somewhere leads to a missing post on the your site.
The plugin, on the other hand, shows broken links from your posts to any site, either your own or external. For example, if your blog is blog.com and you link to example.com/article.html in a post, and that page (article.html) goes missing one day, the plugin will tell you that the link to example.com/article.html is “broken”.
Hi,
Thanks for the plugin – very neatly done. I modified your source so that it includes a javascript mechanism to resort the broken links by post date (or by the original last check date). I’ve tested in firefox so far – going on to test in IE. Haven’t tested under heavy load yet (massive number of broken links).
Wanted to know if you were interested in the modified source for inclusion back to the trunk when I’m done?
~Aron Beal
@Aron Beal – Sure, sounds like a useful feature. You can post a link here or email it to me at whiteshadow@[this domain] when it’s done.
On my dashboard I get a notification of a lot of broken links but when I check them there’s actually none. This started to happen when I deleted a page where all those links (of images) belonged.
@Nelson – This might be caused by a database bug in an older version. Click “Re-check All” on the link checker settings page to reset the plugin’s tables. It will probably take a while to recheck everyghting, but it should fix the problem.
@White Shadow – That’s odd. I believe I had already done that before. Anyway, I’m glad it really did the fix this time. Thanks!
[...] if you’ve been blogging more than a year, here’s a plugin you might find helpful: broken link checker. Whenever you’re logged into the WordPress Admin area, this handy plugin will spider all the [...]
[...] Broken Link Checker: I love this plugin! It is new to me, but one of my favorites already! Too often links go bad, this plugin checks your complete site and lets you know if there are any links that don’t work anymore. Here is what they wrote about it: [...]
[...] Broken Link Checker – This plugin will monitor your blog and looks for any broken links and let you know if any broken links are found. [...]
After installing broken link checker, it seems that only account authors with a status of “admin” can access the link checker. Is there a way to let other user status’ to access the link checker as well?
@Drew McManus – It is done. Editors (in particular, users with the “edit_others_posts” capability) can now access the page as well. The update should show up in 24 hours.
@White Shadow – Wow, that was fast, many thanks!
I find that this plugin often displays broken links for images in post and links to photos in my NextGen gallery. Testing the links shows that they are not broken. When I tell the plugin the recheck for broken links it then comes up with none. A little strange…..
@AJ – Probably just temporary glitches with the links, that does happen once in a while. There isn’t anything substantial I can do about it.
This is an excellent plugin, I’ve included it in my must-have maintenance WordPress plugins list at:
http://www.howtomakemyblog.com/how-to-set-up-a-blog/must-have-wordpress-blog-maintenance-plugins/
Thank you for the wonderful plugin!
I tried it out for a few days and it was working well (and even helped me find a couple of links that had recently changed. However, it is now reporting a status of “Error: You can’t do that. Access denied.” while logged in as an Administrator. Any suggestions?
@Lance – That’s strange. I recently updated the plugin and changed what capabilities are needed to see/edit broken links : now it’s “edit_others_posts”. Administrators should have this capability by default and I haven’t encountered any problems with my two blogs (WP 2.6.3 and 2.7-almost-beta).
Are you using the latest version of WP? Also, can you still access the Manage -> Broken Links page?