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 :
@ 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.
Alas, after a lot of testing and googling, I’ve discovered that this is probably a CURL bug. So it’s not something I can fix.
Bummer; I wish I had done the redirects before we moved servers; it was great stuff that I wouldn’t otherwise find. I really appreciate your effort in tracking this down, but just so I understand a little bit more, is CURL an ingredient in your plugin? Is it something that is installed on my ISP? Is there something they can patch if I ask them? Etc. etc.
CURL is a command-line tool and a software library for transferring data over a variety of Internet protocols (e.g. HTTP). The library component (called libcurl) is installed on a lot of servers and can be used by PHP. I use it in my plugin because it’s generally a very robust and versatile way to query remote URLs.
You could ask them to upgrade to libcurl 7.18.1 or later (the latest version is currently 7.19.6). That should fix the bug.
Hey there, I’ve got this error once I installed the plugin.
database_name.wp_blc_links’ doesn’t exist
Any ideas? I tried activating and deactivating…no luck
No useful ideas so far, but the next version will be a bit more verbose when reporting errors like that (which should help us locate the bug) and do it upon activation so that you can see that there’s a problem right away.
[...] Broken link checker: Se encarga de revisar los enlaces salientes de nuestro blog y comprobar que estos están activos aún o no. Muy útil para artículos antiguos. [...]
Every time I update Broken Like Checker, I have the same 15 broken links appear. All of them contain “2009/08/category/” in the URL. I remove this from the link and every thing is fine until the next upgrade. Is there something within the plugin that creates this problem? Or is it being created by some other plugin?
Hi there!
I have a problem with your plugin… every time I update it, I have to change one line (this update l. 2218) into $path = ini_get(‘upload_tmp_dir’);
It is the opendir restriction, so do me a favor please and change it
Have a nice day,
Asmodiel
@ Keyword-SEO-guy : I’m guessing those links use relative URLs, right? This is a bug in the plugin; I’m uploading a fixed version to wordpress.org as I write this.
@ Asmodiel : Alright, though I’ll a bit differently