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.
A client just pointed out to me that most of her links were being marked as broken recently (but they were not), so I uninstalled and reinstalled the BLC plugin and something broke in header before the pages would load. I removed the directory from the server and tried installing again, with the same problem.
Any ideas why activating would throw a monkey in the works? I had installed a video plugin recently that interfered with sidebars and promptly removed it, but haven’t done anything else within the last few weeks.
Hi,
Seems this plug-in can not handle an apostrophe (if your blog name includes one) for e-mail when user enables “Send me e-mail notifications about newly detected broken links”.
The subject of the e-mail uses the html code for the apostrophe instead of the apostrophe itself.
“[Will & # 0 3 9 ; s Technology Blog] Broken links detected”
Example above. I had to move the characters apart or the browser would render it as an apostrophe anyways. 😉
Or just see: http://paste2.org/p/998112 That’s the subject line of my emails.
If this could please be fixed?
Thanks,
Will
@ Michelle: Check the server logs for PHP errors – they might provide some clues. Also, what’s your PHP and WP version?
@ Will: Sent you an email with a patch.
Wow that was quick.
Thanks buddy!
@White Shadow – Ah, got it. The site is still on WP 2.9.2. Must have been using an older version of the plugin originally, so trying to activate it caused the issue. I’ll try to talk my client into upgrading her WP. Thanks for the speedy reply (and the helpful plugin!).
[…] Managerプラグインのサイトを表示 Lightbox 2プラグインのサイトを表示 Lightbox Galleryプラグインのサイトを表示 […]
I just uninstalled and reinstalled BLC and I’m now having the following issue:
Within comments, sometimes fragment URLs are being created. In the past these would not show up in BLC but now they are all in the redirect section, with the wrong URL prepended to them.
Example:
#comment-2 > http://www.jeromeaoustin.com/blog#comment-2
when it should be:
#comment-2 > http://www.jeromeaoustin.com/2009/04/14/easter-parade-2009/comment-page-1/#comment-2
I’m trying to figure out where that issue is coming from.
Would there be a way to just ignore that parsing so it doesn’t show up? Maybe as an option. I can see in the changelog that the following was done:
“Fixed incorrect parsing of relative URLs that consist solely of a query string or #fragment.”
[…] Broken Link Checker for WordPress | W-Shadow.com から2010年9月24日に引用 大半は、Lifestreamのリンクでした。ただ、中には移転したところとかもあって。アラアラというのも。私のブログも思いついたときにこちらに統合中(今は2008年8月を処理中)ただ、旧ブログも画像を撤去したので見えづらくなりますが、閲覧可能です。バッサリ削除するのではなく、転送指定してやるつもりなのですが、なかなか思うようには… […]
Thanks a lot for sharing this very good plug-in. You were actually mentioned in a free WordPress e-book that is why I followed the link ehre.
Again, thanks a lot…I am now using it in my blog above.
I finally found your site and the free download from Google…
Thanks…
[…] unmöglich alle per Hand kontrollieren. Jetzt habe ich, dank dem Broken Link Checker Plugin von Janis Elsts, eine gute Lösung gefunden, damit es keine Links mehr gibt, die ins Leere führen. Das […]
@ Jérôme : I’ve found the source of the problem – the plugin incorrectly uses the homepage URL of the blog when parsing relative and fragment URLs in comments. This will be fixed in the next release.
[…] Project page […]
@White Shadow: Great!
Greate plugin! I was looking for something like that, thanks!
One suggestion, though: when unlinking, is it possible to put the broken URL in the title attribute?
This way, the broken link would not be a link per se anymore, but would maintain the broken URL for historical reasons.
Maybe this behaviour could be set through a check box on the admin panel…
Maybe even a preffix for the title, like “Old URL: ” or “It was ” could be set there…
What do you think? 😉
That’s a good idea, and easy to implement, too. I’ll put it on my to-do list.
I know I’m pushing, but any idea on an ETA?
Sorry to ask, but I have a lot of broken links on my 4-year blog and would like to start fix them. If you are too busy, while I wait, I intend to hack the code (nothing fancy) to put the broken URL in the title attribute.
But only if you are too busy… 😉
Phew! Just took a look on your code: it’s way over my skills…
Guess I’ll have to wait the new version with your fix.
Yep, I must admit it might be a teensy bit over-engineered.
Anyway, I’ve implemented your suggestion in the development version.
Thanks! I’ve downloaded and am uploading it right now!