Get Notified When Visitors See 404 Not Found Errors
Recently, I overhauled a few sites including this one, merging several WordPress installations into one for easier management of content. It is inevitable I’d get some 404 page not found errors. Maybe you landed on one yourself. My sincerest apologies if that has happened to you. I am working hard to clear the 404 error logs or at least minimize it. The problem with this site is, it’s not only merging two WordPress installations – that would have been fairly easy. I also was merging a lot of old static HTML sites dating back to 2004. That’s pretty old for the Internet. So… there’s a lot of work to be done to say the least.
Despite my excellent VA and technical assistant’s best efforts, things still can slip through the crack so my next task was to install a 404 notifier. Something that would alert me by email whenever a 404 page is displayed. If you’d like to have something like this set up on your WordPress powered site, here’s how.
- First, make sure you have a 404 template for your theme. If you don’t have it, create it. It’s easy. Copy the index.php and strip out the ‘Loop’ and post data.
- Next, enter some message that people will see on your 404 page. A good idea, let them know what has happened, suggest other content, provide a search box and hey, have fun with it.
- Then, you add this code somewhere in the file, doesn’t quite matter where but I normally put it towards the end, before the footer. Remember to add your email address:
"); #email you about problem
}
?>
Now, you’ll receive an email every time there is a 404. Warning! If you’ve recently changed a lot of things around or you simply know there is a lot of errors on your site, be prepared to receive a lot of email. It’ll be a good idea to filter these messages or send them to a VA to handle :). Also, sometimes the error is not obvious. The email is generated but you’re not quite sure what generated it. That does happen. I usually let it go until a later date. Because of spam, you may also get false positives on comment pages. You’ll just have to ignore those.
Do You Want A Hands-Free Business?
Then get this guide to help you systemize your business so you'll have more time working on your business.
Hey! I want to make sure you know what you're getting here. In addition to the guide, you will also receive our memo that includes special offers, announcements and of course actionable information.