When navigating a website, few things are more frustrating than landing on a screen with a 404 error, “Page Not Found."
This issue can cause users to quickly click away from your site.
To prevent this, ensure that your internal page links are correct and functioning.
But what happens if someone types in the wrong URL or the slug of one of the page links changes?
Unfortunately, it is inevitable for users to end up stumbling across a non-existent URL.
However, you can take steps to help people get back to the page they were looking for so they don’t leave your website.
Why Do I Need A 404 Page?
One way to create a positive user experience when users become misguided is to add a custom 404 page to your website.
This allows you to provide a bit of character and personality, perhaps even humor, and a link for them to get back on track.
Additionally, you could add links to other popular pages, such as blogs, or direct them to a form to report the bad link.
You might be tempted to link a 404 error instance to your homepage instead of a custom error page.
This can confuse the user, as they may not realize they had an incorrect URL because they still end up on the homepage.
Redirecting users to the homepage can also affect your SEO, as search engines still see this as a soft-404 error.
According to experts, redirecting all 404 links to your homepage will be problematic. Website owners should always focus on building user-friendly 404 pages.
Setting Up A Custom 404 Page
Depending on the WordPress theme, you have a few options to create a custom 404 page.
Using a plugin to create a custom 404 page should work well with any up-to-date theme.
Classic WordPress Themes & Block Editor Themes
Option 1: Use Theme’s 404.php
If you are comfortable working with your website’s PHP files, many themes will already have a template for a 404 page.
- Go to Appearance > Theme File Editor in the WordPress dashboard.
- Select your theme in the dropdown menu and look for the 404.php file.
- Ideally, copy the 404.php to your child theme so you won’t lose your work with theme updates.
- Personalize the text, add an image, or other elements to make it your own.
- Click ‘Update File’ to save your changes.
Option 2: Copy A 404.php File
Some themes may not include a 404.php file. If this is the case, you can copy a 404.php file over from a different theme, such as Twenty-Twenty.
- Find a theme with a 404 page that you would like to use.
- Navigate into the theme folder for that theme and make a copy of the 404.php file.
- Move the copy into the theme folder of the theme or child theme your site uses, ensuring it is called 404.php.
- Check the 404 page at your site’s front-end to ensure everything looks as expected.
- Make changes to the file in the Theme File Editor and hit ‘Update File’ to save your changes.
Option 3: Copy The Index.php File
If your theme does not include a 404.php file, this is another alternative to create one.
- Duplicate the index.php file.
- Rename the duplicate 404.php.
- Remove the code used to display posts.
- Personalize the text, add an image, or other elements to make it your own.
- Hit ‘Update File’ to save your changes.
This option requires some PHP and HTML knowledge, but it means that the 404 page will match your current theme, making it cleaner than using a 404 page from a different theme.
Create A 404 Page Within A Page Builder
If you are using a WordPress page builder such as Elementor, Divi, Beaver Builder, or Oxygen, you can add a 404 page within the builder’s interface.
Consult your preferred builder’s documentation for more details on adjusting the settings to redirect wrong URLs to your custom 404 page.
Use A 404 Page WordPress Plugin
An easy way to add a custom 404 page to any WordPress site is to use a WordPress 404 page plugin.
Examples of these plugins include:
- 404page – Your smart custom 404 error page: This free plugin allows you to create a custom 404 page by selecting a created WordPress page as your 404 page in the ‘Appearance’ section of the WordPress dashboard.
- SeedProd: This plugin allows you to create beautiful, lightweight, customized 404 page templates for your website.
- Colorlib 404 Customizer: This free plugin uses the Live Customizer to create a custom 404 page that matches your site’s look.
- Custom 404 Pro: This plugin lets you create a custom 404 page within the Pages section of the WordPress admin dashboard and track instances of URLs that prompted the 404 page.
Full Site Editing
If you are using a WordPress Full Site Editing Theme, creating a custom 404 page is easier than ever. Here’s how you can do it:
- In the WordPress dashboard, click on Appearance, then navigate to the ‘Editor.’
- Under Editor, select Templates.
- Select the 404 template.
- Use the block editor to create your custom 404 page and save it.
- Hit Save again to save the template.
WordPress Custom 404 Pages
A broken link or incorrect URL doesn’t have to be a disaster.
You can make your 404 error page fun and keep the user engaged by providing links to your homepage or other pages of interest on your website.
Creating a custom 404 page on WordPress is easier than ever and enhances the user experience.
This page also allows you to track when visitors find your 404 page so that you can correct links or redirect pages when appropriate.
If you want to see some creative 404 pages, visit some of your favorite sites and type in their URL followed by a page you know doesn’t exist.
You’re sure to get some great ideas for your own 404 pages!
More Resources:
- Are 404 & Soft 404 Errors Google Ranking Factors?
- Google: Fine if 30-40% of URLs in Search Console Are 404s
- Advanced Technical SEO: A Complete Guide
Featured Image: apghedia/Shutterstock