What is a 404 error?
A 404 error is generated by your web server when the requested page is not found on your WordPress website.
Every WordPress theme has a 404.php file, but only some themes will have their own custom 404 error page. WordPress will automatically use that page if a page not found error is encountered on your website.
The page that is displayed when the requested page can’t be found is largely determined by your theme, but here’s a common example of 404 error wording:
If you have used a default WordPress theme for your website, the 404 error can be confusing and you’ll likely lose visitors due to broken links or the user entering a typo and reaching a page on your site that doesn’t exist.
Why is it important to have a custom 404 page?
The thing you need to consider first and foremost is the visitor’s state of mind. They are already likely frustrated and annoyed when they’ve reached your 404 page, as they can’t find the page they are looking for.
As a website owner, you have a responsibility to help your users find the page they are looking for if you don’t want them to bounce and leave your site for good. For this reason, it’s a much better idea to include a custom and “friendly” 404 page to avert such a situation.
Compare the previous WordPress 404 example, with this one:
The above is a much better choice as a custom 404 error page, as it provides the user with a search box, to find the content they’re looking for on your website. Even better, it provides guidance on how to perform a website search and even offers some recent blog posts to read.
By now, it should be clear that this custom 404 approach is much more likely to retain users on your website.
How to set up a custom 404 page
Many WordPress themes have a custom 404 page already designed, so you can likely leverage off that, but it may still be sub-optimal. If you decide to create a new custom 404 page, you can follow the steps below:
First, create your custom 404 WordPress page. This is the same as creating any other WordPress web page. Just set a name for the page as if it was a new page on your site.
Then go to cPanel:
and find your .htcaccess file and right-click to edit it:
Add the following line to your existing htcaccess file, replacing 404ErrorPage with the name you gave your custom page as described in step 1. eg:
ErrorDocument 404 /Custom404Page.html
If you don’t have access to cPanel or wish to set your 404 page using an easier method, install the excellent free WordPress 404 page plugin. Details of the plugin and instructions can be found here.
After setting your preferred 404 page, it’s now time to customise it, to reduce the bounce rate from visitors.
Install and activate the excellent Recent posts widget extended
that provides the ability to display recent/popular posts in a WordPress widget:
Go to the new 404 page you created in WordPress and change the input method to Text (HTML) and enter the code below to display the last 5 blog posts on your 404 page:
Write a friendly message
It’s important to reassure a user in a friendly tone that they’ve encountered a minor issue and you’re here to help them find the resource they are looking for. You can simply edit your custom WordPress 404 page (as mentioned above) to do this. Here’s an example:
“Oops! Sorry about that ☹
As much as we try to always get things right, sometimes we don’t!
You can try a search here: or visit our recent blog posts here:
We hope we’ll do a better job next time!”
You can also add a search box on the page if your theme supports this functionality. If not, you’ll need to edit code which can get messy!
A custom 404 error page is a really great opportunity to keep users on your site, or even better, direct them to their desired destination.
Users are generally frustrated when they encounter a 404 error. It’s important to guide them back to their desired destination on your site as quickly and easily as possible. This makes for happy users and reduces your bounce rate.
To read other WordPress posts
click here. Our previous SEO posts
can be found here.