Professional WordPress Themes

Aug 22, 2011

Nominate Broken Link Checking

The Nominate social voting theme allows you to give your visitors access to submit their own content to be voted on, on your website.

The problem with this is you then have no control over what happens to their content in the future. If they delete a post, close the website, change the url structure, or generally change things around, then your website will end up linking to broken content – and that’s not good.

I experienced this same problem on WPVote.com – so I decided to come up with an automated method for fixing it.

So, I created a function that would check 10 articles at a time, in a never ending loop (it runs twice a day for as long as the theme is active). I decided to limit the number of articles scanned to ensure that the server does not get overloaded as the check can be a slow process. Technically the system uses curl to check the external articles header response. Based upon the response it does a variety of actions.

  • 200 – all safe, you can carry on as normal
  • 404 – the article has been deleted. There’s no redirect so the submitted article on your site is moved to the trash (you can always move it back if you wish)
  • 301 – the article has been moved. The article link gets updated and things carry on as normal
  • 501 – server error. The article gets moved into your post drafts so that you can check it and republish or trash it as you wish
  • 0 – no response… nothing happens.

Each time a scan is done you will receive an email explaining any changes that are made so that you can double check/ modify things as required. If you have a reasonable amount of articles submitted then I would guess you will get a lot of emails to start with while old posts are scanned, and then it will even out over time.

As I mentioned in the status list above, sometimes no response is received. In this case you will be told about it in the email. In my tests on WPVote.com I have had a response of 0 in all sorts of instances – often for what should be 301 or 404 errors – and so I go in and edit things manually.

The goal of this update is to make it easier to manage your Nominate powered websites content, and to keep your site relevant and up to date.

To update just grab the theme from the accounts control panel and reupload it to your site. Everything else will happen automatically.

If you make use of it then please do let me know how you get on in the comments below.

Leave a Response

About Us

Pro Theme Design began in 2007 as a collaboration between two web designers...

Darren Hoyt
Darren Hoyt

Charlottesville, VA, USA

Established in the WordPress community for projects like Mimbo and Agregado, Darren also has 14 years experience designing websites for businesses and startups. His role at Pro Theme is taking what Ben builds and making it beautiful and simple to use.

Ben Gillbanks
Ben Gillbanks

Exeter, England, UK

Ben is a WordPress ninja, best known for creating Regulus. More recently he took over the development of the image-resize script TimThumb. He spends his time at Pro Theme Design turning Darren's ideas into reality.

Email us general questions or visit the support section with product questions.