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! (10 KB)
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.3.5 : broken-link-checker.zip (10 Kb)
(It needs at least WordPress 2.0.x to work, maybe 2.1.x. I’ve tested on 2.1.3 - 2.5)
July 31st, 2008 at 8:52 pm
[...] was made possible by the Broken Links Checker plugin for WordPress, which made the process very easy and helped me to detect/repair links in all of the posts on the [...]
July 30th, 2008 at 4:44 pm
[...] Broken Link Checker [...]
July 28th, 2008 at 12:59 pm
@Michael Hampton - Hmm, good point. I’ll update the plugin.
July 28th, 2008 at 12:02 pm
Looks like I found a bug. The broken link checker 0.4.3 records a URL which returns a 401 as a broken link. These are NOT broken links. They’re sites that require a login. Example is http://www.totalfark.com/
July 24th, 2008 at 11:04 pm
@Cynthia - that would be a pretty complex task. Not likely in the foreseeable future.
July 24th, 2008 at 10:53 pm
I’m running WordPress 2.6 and just installed Broken Link Checker 0.4.3. I thought this was working beautifully on two different sites but I just noticed a Fatal Error message at the bottom of the Write Post page on one of the sites (not the other one, which is a different ISP):
Fatal error: Call to undefined function: curl_init() in /wp-content/plugins/broken-link-checker/wsblc_ajax.php on line 294
Can you issue a modification that doesn’t use Curl?
July 20th, 2008 at 8:45 am
Nope, same problem (error 500) also with version 0.4.3.
July 19th, 2008 at 1:07 pm
@Karel - okay, it makes sense to exclude revisions & autosave. I’ll add this right now.
Also, Eric, this might be the cause for the unexpected server load you experienced (maybe :P), so the next version might work better.
July 19th, 2008 at 11:34 am
Excellent plugin.
Two suggestions:
- exclude ‘revisions’ and ‘autosave’.
- include an option for ‘orphaned pages’ (I have so many pages and can’t really tell which ones are actually being linked to…)
July 19th, 2008 at 9:23 am
I had huge problems with this plugin eating up lots of resources on the server, leading to 500-er “internal server” errors after I upgraded to WP 2.6. Therefore I had to disabled the plugin for now. this is using the latest plugin version.
July 18th, 2008 at 5:49 pm
Oh well, I can understand that that is not a very common use and priority must be given to regular users. So if it’s on your list is more then enough for me
July 18th, 2008 at 5:20 pm
@Razvan Antonescu - I’ll add that to my idea list. Though I can’t promise you’ll see it implemented anytime soon.
July 18th, 2008 at 4:17 pm
On one of my projects, images and links are added in custom fields. Coould you please consider as an option a check in custom fields? Thanks
July 17th, 2008 at 3:19 pm
Works fine with WP 2.6!
July 17th, 2008 at 1:16 pm
@Eric - I’ve upgraded to WP 2.6 and seems to be working for me still. Maybe you tried to “unlink” an image? That would produce the popup you mention.
@Jvista - maybe someday
July 17th, 2008 at 2:42 am
Hi. Thanks for your great plugin! It’s making trouble with WP 2.6, though: If I click “unlink” it tells me that it cannot edit the post (in a popup).
July 16th, 2008 at 12:43 am
Hello, Yeah, as the plugin “Broken Links”, but than report videos of youtube deleted or removed, inserted for Embed direct in wordpress, as:
==============
==============
So bloggers we can always know when a video has been removed, and can us update it.
maybe rename to “Yotube Broken Links” or “Youtube Broken Embed”,
Well, Thanks! for “Broken Links”, is a exelent plugin!
Good Luck!.
Sorry for my english, I don´t speak english. =/
July 15th, 2008 at 4:31 pm
[...] like to click on a broken link? There are a few ways to remedy this solution, but I found this broken link checker for WordPress that does the job extremely well and is completely free. You do not want your readers [...]
July 15th, 2008 at 11:25 am
@Jvista - You mean embedded videos, right? That’d depend on how they’re inserted in the post - just the HMTL or via some plugin.
July 14th, 2008 at 12:41 pm
Hello, can you create a plugin that report the videos removed from youtube?
That would be impressive!
Thank you.!
July 14th, 2008 at 12:16 pm
[...] Broken Link Checker for WordPress - As your blog gets more and more posts, it can be difficult to go back and look for what has broken with time. This plugin will check images and links and notify you via the dashboard when it locates something. [...]
July 10th, 2008 at 12:13 pm
@bob cobb - your server doesn’t have CURL installed, and this plugin will not work. There is no workaround except for installing CURL.
July 10th, 2008 at 5:28 am
I got this on my dashboard after I installed it: Fatal error: Call to undefined function curl_init() in /home/igneous/public_html/wp-content/plugins/broken-link-checker/wsblc_ajax.php on line 292
July 9th, 2008 at 7:51 pm
[...] Mashable posted an article on the 20 best Wordpress plugins for version 2.5. One on the list was Broken Link Checker. I had an ah-ha moment and immediately went to the site and read about the plugin. I was a little [...]
July 9th, 2008 at 6:27 pm
[...] Broken Link Checker Like the name describes, this plugin makes sure you don’t have any annoying broken links. A good plugin to use to ensure your blog is the best it can be. Tags: Blogging, business, entrepreneur, grow, help, Innerpreneur, links, marketing, seo, share, small, tips, WordPress [...]
July 8th, 2008 at 12:23 pm
@Kim Woodbridge - Welcome
July 8th, 2008 at 9:02 am
[...] Broken Link Checker for WordPress - Links und Foto-URLs überprüfen. [...]
July 8th, 2008 at 5:28 am
Well, I installed it and have it running now in a separate browser window. It’s slowish but is running without any problems at all. It’s gotten about halfway through the 3500 posts in 1.5 hours and has found 82 broken links so far. I immediately changed the checking schedule to weekly and may even change it to monthly. So, even if this does take 3 hours it is still so much faster than I can do it manually. So, thanks for a great plugin and we now know it can handle an unusually high number of posts
July 8th, 2008 at 4:34 am
[...] Broken Link Checker for WordPress - As your blog gets more and more posts, it can be difficult to go back and look for what has broken with time. This plugin will check images and links and notify you via the dashboard when it locates something. [...]
July 7th, 2008 at 10:20 pm
[...] Broken Link Checker for WordPress | W-Shadow.com [...]