As we all know about 404 error page which is a error message from the server over a HTTP response from client side. I have seen many theme developers ignore 404 error page on wordpress, which I believe is a big mistake, as it increases bounce rate of website and reflects bad impression on visitor who landed in a deadlock situation.
Default 404 Error Page
Many visitors type wrong URL and end up landing to default error page from server. You can see the default 404 error page design below in screenshot.
How Bounce Rate Increases ?
The above page is a dead end page where there is no navigation or any message to redirect to different link. In such a situation, visitor will either use Back button on browser or will type another URL in address bar. As mentioned above, default error page is displayed when there is no 404 error page code in wordpress theme, and now you can assume how you lost a visitor. Hence it increases the bounce rate, as a visitor just landed on your website and went away.
Add 404.php in WordPress
As we are familiar with wordpress themes, and most of them has 404.php page. But if somehow your theme folder doesn’t have 404 error page then you don’t have to worry. Follow the simple steps below to add 404 error page in wordpress:
- Open any text editor, for instance Notepad.
- Add below code snippet in the file.
<?php get_header(); ?> <div id="content"> <h2>Sorry...</h2> <p>The page you are trying to reach is unavailable or does not exist.</p> </div> <?php get_sidebar(); ?> <?php get_footer(); ?>
- Save the file as “404.php” and move it, into the theme folder.
Enhance 404 error page
Now, we have added custom design error page in wordpress blog. Since it is a PHP file, we have extended capabilities to innovate and enhance 404 error code. We can add google adsense code in 404 page, so that you get paid atleast when visitor leaves your site. You can play with the custom error code in 404.php file by adding images and eye catchy quotes.
In the end, I will just conclude that, every website should have custom 404 error page, so that visitor shouldn’t feel deprived. I hope this tutorial was easy, but if you have any query or any further assistance required then you post comment as your feedback.