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 :
Surprisingly enough I tried to activate the plugin again and now it is working like a charm. It’s a great plugin. Thank you.
Thanks a lot! Now it works …
Hi there,
one more question…. may your plugin generate strange url structure that Google WM tools detect as nothing found error?
like that follow:
http://www.luxemozione.com/2007/06/2009/09/incandescenza-non-ci-vedremo-mai-piu.html
Im also using a plugin that might caused these errors (about 100) but i’d like a confirmation…on 28 septermber, when the problem started, i have installed new translation plugin (that unfortunatly i bought) and updated yours as well.
thanks
G.
I don’t think it can do that. Still, you could always deactivate the plugin temporarily and see if the problem goes away.
Hi, ok ok BLC is now deactivated, I’ll keep you informed if something change
Thanks
Hi! one more little question, I noticed that you did’t insert last version changelog… there were significant change until V.0.5.12?
Bye
G.
[...] Broken Link Checker for WordPress – W-Shadow.com [...]
I’m just lazy about keeping the changelog up to date. I’ll update it in a minute.
Ok
! I know the problem….
@ Doc4: I’m not seeing any conflicts with Google Analytics or Incoming Links, or any other dashboard section. Like White Shadow says, I’d suspect JS…
Here’s a puzzler. I have a variety of links to Cooks.com, something like these two:
http://www.cooks.com/rec/view/0,1926,153171-253196,00.html
http://www.cooks.com/rec/search/0,1-0,chile_verde,FF.html
These always show as broken links, while they seem to work fine. the Details panel says response time is 0.000 seconds, and the final URL looks something like:
http://www.cooks.com/rec/view/0%2C1926%2C153171-253196%2C00.html
HTTP Code 2 is shown there as well. The log shows “No response” as the error.
Any ideas what’s going on? Just curious; I can leave the links in, they work…
Do you have an old version of the plugin? It shouldn’t really be possible to get a HTTP code 2 in the newest version(s).
Apart from that, it sounds like it could be something on your server. The plugin correctly identifies the two links as working when I try them on my test site.
Well, I always did enjoy doing the impossible. [grin] I have version 0.5.13, the latest (I believe) as I upgraded using the WordPress plugin auto-updater. I’ve also noticed a bit of odd behavior: I’m not getting any strikethroughs on broken links on my posts anymore.
I’m pleased that the test on your site went well; however, that deepens the mystery for me…
I have two questions:
1. Is there a way to set the plugin to manual only execution mode?
2. Is it possible to use it with proxy servers(im a little worried that Google would label the IP of my site as scrapper if i visit so many links so fast with the plugin)?
@ Mitchell : Do you remember when you last saw the strikethroughs working? I ask because the relevant code hasn’t changed at all in the last two or three minor releases, so if it worked then… well, it would be another little bit of weirdness I could chalk up to your server config being unusual. I jest, of course.
@ Mike :
1) No, and I’m not planning to add that.
2) Yes, BLC has partial proxy support (i.e. it only works when CURL is available). It will obey the proxy config. defined in wp-config.php (if any). See this page for details on using proxies in WP.
Well, I’ve only been using the plugin for 7-10 days. It showed the strikethroughs when I began to edit/repair my broken links. I’d look at the post first to see how it was showing the broken link; always strikethrough. Now, nothing. I haven’t changed anything (that I know of) in the WP install or the theme in those few days.
As you say, server voodoo at work. At least the plugin’s identifying links for me to repair, and I’m cleaning up the site (slowly). Down to about 75 busted links! Thanks…
hi, i have found 1200 broken links that i want to delete all. pleas can you tell me how can I delete all broken links at once ? for example : can i add checkbox to this plugin ? if yes, pleas tell me how can I do it, because I’m not so good in PHP
. thanks lot for this plug-in and sorry for my bad English
@ Mitchell : I really have no idea why they’re not showing up. I’ll see if I can add some debugging features in the next version that might help find the cause for this bug.
@ walid : It’s non-trivial to implement, and deleting 1200 links at once would overload your server. So probably not anytime soon.
I was pretty excited when I found this plug-in, but it keeps telling me there are broken links that 1) I’ve gone back and fixed or 2) where there aren’t any, so I’m going to deactivate it for the time being.
It’s a great idea and I’d be interested in using it again once those two issues are fixed.
Amazing plugin. I’ve been working with it for a few months now. When I first installed it I had around 400 broken links and 800 redirects. Many of the redirects were silly, i.e., a redirect to portigal.com/blog/ where the link in the entry was portigal.com/blog [i.e., the trailing slash] – but many of the redirects were very important, essentially broken links, where I had linked to an online article that was now online and redirecting to the site’s main page.
What I see now – after a few upgrades to the plugin over the period of time I’ve been working with it – is ZERO redirects. I know that’s not right, even if you stopped checking the silly ones (so to speak) the egregious ones would still show up as redirects.
Now at some point in the past few months we did move servers at our ISP (I see that was one of the issues in previous comments). Any thoughts on what I need to do to get my redirect reporting back? THANKS and I’m so happy to have this plugin!
It might be related to the ISP change, but I’ll really need more information to tell for sure. You could do a test : post a link that you know is a redirect and check how it displays in the plugin’s link list (the newest links usually can usually be found on the last page of the list). Does it show up as broken? Does the plugin say it has “Redirect count : 0″ but still report it as working? Something else?
I got this error. How to fix this:
Table ‘tvtinh_blogviet.wp_blc_links’ doesn’t exist
Thanks
Try deactivating the plugin and activating it again. Also, make sure you have the latest version.
Can you please extend the number or hours in “Broken Link Checker Options->Check each link” and add at least one more integer. Currently the maximum that can be entered is 999.
I would need this functionality because i only enter the admin area of my blogs once in couple of months to update some plugins etc. What then happens is that i have to wait for the plugin to finish the work and that can last up to 30 minutes. And i have multiple blogs that i manage…so it can take me the whole day to do a simple plugin update.
Okay, I’ll extend it to 5 digits.
However, it might be a few days until the next version is out as I still need to fix a couple of other bugs.
[...] Broken Link Checker Es kommt schon einmal vor, dass ein Link nicht mehr funktioniert. Dieses Tool checked regelmäßig alle internen und externen Links sowie von extern eingebundene Bilder auf Funktion. Im Admin-Bereich wird das Ergebnis komfortabel angezeit und man zeitnah reagieren. Außerdem werden Links, die nicht mehr funtionieren für den Leser durchgestrichen dargestellt. [...]
re 796 and your response 797
I posted http://news.yahoo.com/news?tmpl=index&cid=716 which – when in the body of my post – redirects to http://news.yahoo.com/top-stories (but when in the address bar of my browser redirects to http://search.yahoo.com/404handler?src=news&fr=404_news&ref=&url=http%3A%2F%2Fnews.yahoo.com%2Fnews%2Fsections%2Fmaple%2Fen-US%2F )
And nothing changes on the page of links. There are no redirects listed, and the number of broken links has not changed; looking at the last page of broken links I don’t see anything at all re: this post; and there’s nothing in the work queue.
Interestingly enough, that link is correctly detected as a redirect when I try posting it on my test blog.
Check the last page of the All list, that’s where it will show up if it’s not detected as broken or redirected. Also, if/when you find it, click the “Details” button and check the log; it might be useful.
Does your server have PHP safe_mode or open_basedir enabled? That’s known to cause problems with redirects.
I tried again; this time I used http://www.portugalconsulting.com which redirects to http://www.portigal.com
Details, from ALL
1. Post published on : October 15, 2009
2. Link last checked : October 15, 2009
3. HTTP code : 200
4. Response time : 0.109 seconds
5. Final URL : http://www.portugalconsulting.com
6. Redirect count : 0
7. Instance count : 1
1. Log : === First try : 200 ===
HTTP/1.0 200 OK
Connection: Close
Pragma: no-cache
cache-control: no-cache
Refresh: 0.1
Content-Type: text/html; charset=iso-8859-1
Link is valid.
I checked with my ISP and we have neither have safe_mode nor open_basedir enabled.