SaaS SEO
Find MRR with our SaaS-tellite technology
B2B & Enterprise SEO
Go boldly where no business has gone before
Wordpress SEO
Navigate the WordPress wormholes
Webflow SEO
Ride Webflow's cosmic currents
Shopify SEO
Parallel universe where your store makes money
AKOOL Launch Plans
Case Study: Building a Webflow SEO strategy
Yaasa's WooCommerce Dev & SEO
Case Study: How we broke through a Google penalty
Woocommerce Development
Woo-w your customers with a stellar storefront
Website Migration
Migrate your site to a more host-pitable planet
Casino M8trix Feature Dev & APIs
Case Study: How CasinoM8trix launched a new blackjack API & feature design
Wordpress Vs Webflow
Analysis: We review the choice between WordPress & Webflow
SEO Low Hanging Fruit Analysis
Guide: How we find and chase down SEO quick wins
Team
The galactic senate
Case Studies
Starship graveyard
UX Strategies for SEO
Analysis: What impact does UX have on your rankings?
SEO First Blog Design
Guide: Designing your blog for sales
Ethan's Shopify SEO
Case Study: How we grew a shopify site to 15k monthly visits in 6 months
Knowledge Base
A Hitchhiker's Guide to SEO
Blog
If you can find space for more reading
Why We Do Full Service SEO
Why implementation beats recommendations
Costs of Linkbuilding in 2024
Linkbuilding costs & tactics in 2024
Website Requirements Guidelines
How we stay on track
Knowledge Base > Wordpress > How to create a custom WordPress 404 error page?
To create a custom 404 error page in WordPress, you can follow these step-by-step instructions:
1. Access your WordPress website’s files: You can do this through an FTP client or by using the file manager provided by your hosting provider.
2. Locate your WordPress theme directory: Navigate to the `/wp-content/themes/` directory in your WordPress installation.
3. Create a child theme (optional): It’s recommended to create a child theme if you’re not already using one. This way, you can make changes without modifying the parent theme directly. If you already have a child theme, skip this step. To create a child theme, create a new directory inside the `/wp-content/themes/` directory and name it something like “my-child-theme”.
4. Create a new file for your custom 404 page: Inside your theme directory (or child theme directory if you’re using one), create a new file and name it `404.php`. This filename is important because WordPress will automatically use it for handling 404 errors.
5. Open the `404.php` file in a text editor: You can use any text editor you prefer, such as Notepad, Sublime Text, or Visual Studio Code.
6. Add the HTML and PHP code for your custom 404 page: Customize the appearance and content of your 404 error page using HTML and PHP. You can include a message, links to popular pages, search form, or any other elements you want. Below is a basic example of a custom 404 page:
<?php get_header(); ?> <h1>404 – Page Not Found</h1> <p>Oops! The page you are looking for does not exist.</p> <p>You can try searching for the content using the search form below:</p> <?php get_search_form(); ?> <?php get_footer(); ?>
<?php get_header(); ?>
<h1>404 – Page Not Found</h1> <p>Oops! The page you are looking for does not exist.</p> <p>You can try searching for the content using the search form below:</p>
<?php get_search_form(); ?>
<?php get_footer(); ?>
7. Save the `404.php` file: Once you’ve finished customizing your 404 error page, save the file.
8. Upload the file to your theme directory: If you created a child theme, upload the `404.php` file to the child theme directory. Otherwise, upload it directly to your theme directory, replacing the existing `404.php` file if it exists.
9. Test your custom 404 page: To test the custom 404 page, visit a non-existent page on your website (e.g., `http://yourdomain.com/non-existent-page`). You should see your custom 404 page instead of the default server-generated 404 error page.
That’s it! You have successfully created a custom 404 error page for your WordPress website. You can further customize it by adding CSS styles or additional functionality based on your needs. If you ever run in to problems you can always turn to outsourcing.
Useful Links:
Creating a custom 404 error page helps provide a better user experience when visitors encounter broken or non-existent links. It allows you to display helpful information, navigation links, search forms, or other content that can assist users in finding what they are looking for.
While creating a custom 404 error page typically involves some coding, you can also use WordPress plugins that offer a visual interface for designing and customizing error pages. These plugins allow you to create custom error pages without writing code.
On your custom 404 error page, you can include a clear message informing users that the page they are looking for does not exist. You can also provide links to popular pages, a search form, categories, recent posts, or any other helpful information that can guide visitors to relevant content.
Yes, you can include images or videos on your custom 404 error page to make it more engaging and visually appealing. However, it’s important to ensure that the media elements do not distract from the main purpose of the page, which is to help users navigate back to useful content.
Yes, you can track 404 errors on your WordPress website by using various plugins or tools. These plugins can log the errors, provide statistics, and even send email notifications when 404 errors occur. They can help you identify broken links or missing content that needs to be addressed.
A 404 error page is displayed when a user tries to access a non-existent page on your website. It provides information and guidance to the user. On the other hand, a 404 redirect is a technique that automatically redirects users from a non-existent page to a relevant and existing page on your website. It helps maintain user engagement and prevents visitors from encountering dead ends.