Sign in Sign Up

We use cookies to make Serpstat better. By clicking "Accept and Continue", you agree to the storing of cookies on your device to enhance site navigation, analyze site usage, and assist in our marketing efforts.

By using the website, you agree to our Privacy policy

Report a bug

How-to 9 min read July 31, 2019

How to create a 404-error page

Error 404 "Page not found" can be optimized. You can make it interesting and as useful and user-friendly as possible, without spoiling the overall impression of your product. With the right approach, the error page will be your advantage.
Everything must be perfect on a site, even non-existent pages. Error 404 spoils the impression of the site and reduces traffic because users simply close the tab or return to the search engine results to continue looking for answers to their questions.

What is a 404 error

The 404 Not Found response code means that the user is trying to follow a link to a page that doesn't exist or that has moved to another address. A non-optimized 404-error page looks like this:
Error 404 standard template
Or so, if we are trying to get to the page from Google search:
Error 404 when moving from Google
This problem can occur for several reasons:
The error was made in the link to the page (URL).
Page has neen deleted.
Page address has been changed.
The server doesn't work correctly.
In most cases, site owners, especially of the large ones, may simply not be aware of the existence of this error. The more pages and the more complex structure, the easier it is to make mistakes in the link setup. To analyze and check the "bitness" of the links, you can use the "Site Audit" service in Serpstat. It'll analyze all internal and external links of the site, specify the availability and nature of different issues.

To do this, open the list of projects, and add a new one. Enter the domain of the site in the window that opens. The name will appear automatically, but you can change it. Next, click "Create", and run the audit.
Adding project to Serpstat for SEO audit
After that, a window with check settings will appear on the screen. You can set your limits on the number of pages that are scanned, the speed and duration of the scan. It's better to choose the automatic scanning speed in order not to overload the site.

Having finished setting, you can begin the audit. Its duration depends on the number of pages and links on the site.

The result of the check will include all 404 errors that were detected. They are collected in a table in the error summary. In the same table, you can see the problem description and the ways how to solve it.
Site audit in Serpstat
Besides, the service will show the overall level of domain optimization, the graph of the depth of verification and other indicators.

We don't always know at what exact address the error is, and if there is one at all. Moreover, the problem often arises because the user enters the wrong address. Thus, it's better to be safe and think ahead about what the error 404 "Page Not Found" will look like if something goes wrong.

What should be on the 404-error page

The page should be both interesting and useful to the user. The error pattern 404 must be creative and fit into the overall concept. Also, much depends on the specificity and orientation of the site. The page must have a small text with the explained situation to the user.
Developers have a different approach to creating a 404 page, its functionality, and design. For example, online stores often insert a search box so that the user can immediately continue searching for necessary goods and doesn't have to go back. You can leave links to similar products.
Information and entertainment portals attach links to other materials. It's desirable for them to be thematically intertwined with what the user is looking for.

In this case, you need to know the exact page which the user tried to hit in order to offer him a similar product or material. You can easily do it if the URL contains a category or section.

Designers often add interesting animations or even mini-games. From our own experience, we can say that such methods of user distraction from the negative work at 100%. Here's the collection of original page design options for 404:
Sometimes developers redirect the users to the main page or other site pages, without any explanation. You shouldn't do that. As a result, the user begins to nervously poke at the same item in the hope of still going to the desired page but constantly gets the wrong place.

It's better to explain to a person that there is no such page, or it has moved and to offer him or her something in exchange, for example, similar materials, the ability to continue the search or interactive content.

Why is it important

Proper registration of this error directly affects the confidence of a potential client or reader. If users often stumble upon Error 404 Not Found and immediately leave the site, we don't just lose traffic. We give our competitors positions in the search results list.

Search engines track user behavior on sites. Permanent loss of traffic means that the resource doesn't work correctly and doesn't bring any benefit. The optimized 404-error page allows you to retain the user and offer him something useful in exchange. Thus, a positive effect on ranking.

How to create a 404 page

This page is usually created by default for all the sites, regardless of the used CMS. The exception is one-page business card sites. It's important to remember that this is the same full page of your site, just like all the others.

Therefore, you need to know not only how to make a 404-error page, but also how to connect it to the site via the .htaccess file. First, you need to transfer the 404-page template to the root folder of the site. Then open the .htaccess file and write the following code in it:
ErrorDocument 404 http://YOUR_SITE/404.html
YOUR_SITE is the domain, and the entire link is the path to the real page. We enter it in any free line.
404 error in htaccess (ErrorDocument 404)
Due to this, it'll be displayed the 404 page, the template of which we created, and not the standard one. Instead of expanding in PHP, you can write in HTML, there's no real difference.

We fill in on a hosting and check. To do this, make a mistake in any of the links of the site (add or remove a letter, for example). If the server shows a new 404 page, it means that everything is OK. If it doesn't happen, an error was made most likely in the code.

How to make a 404 page in WordPress

Popular CMSs allow you to automate this process and eliminate the need to edit the code manually. For example, in WordPress, this task is solved by the 404-page plugin. It allows you to customize the page with the error "on almost any topic". To install it, you need a version of WordPress 4.0. Similar solutions exist for other CMS.


The optimized 404-error page helps not only to keep the user but also to increase the audience loyalty to the service.

Don't forget that this is a full-fledged page, which should be concerned as much with design and development as with the other site pages and functionality in general.

This article is a part of Serpstat's Checklist tool
Checklist at Serpstat
Checklist is a ready-to-do list that helps to keep reporting of the work progress on a specific project. The tool contains templates with an extensive list of project development parameters where you can also add your own items and plans.
Try Checklist now

Learn how to get the most out of Serpstat

Want to get a personal demo, trial period or bunch of successful use cases?

Send a request and our expert will contact you ;)

Rate the article on a five-point scale

The article has already been rated by 0 people on average out of 5
Found an error? Select it and press Ctrl + Enter to tell us

Share this article with your friends

Sign In Free Sign Up

You’ve reached your query limit.

Or email
Forgot password?
Or email
Back To Login

Don’t worry! Just fill in your email and we’ll send over your password.

Are you sure?


To complete your registration you need to enter your phone number


We sent confirmation code to your phone number

Your phone Resend code Queries left

Something went wrong.

Contact our support team
Or confirm the registration using the Telegram bot Follow this link
Please pick the project to work on

Personal demonstration

Serpstat is all about saving time, and we want to save yours! One of our specialists will contact you and discuss options going forward.

These may include a personal demonstration, a trial period, comprehensive training articles & webinar recordings, and custom advice from a Serpstat specialist. It is our goal to make you feel comfortable while using Serpstat.




We are glad of your comment
Upgrade your plan

Upgrade your plan

Export is not available for your account. Please upgrade to Lite or higher to get access to the tool. Learn more

Sign Up Free

Спасибо, мы с вами свяжемся в ближайшее время

View Editing


You have run out of limits

You have reached the limit for the number of created projects. You cannot create new projects unless you increase the limits or delete existing projects.

I want more limits