How to create a custom 404 page
A custom 404 page is a helpful 'page not found' screen that looks like your site and points visitors onward, instead of the bare default error. You create it with a 404 template on your platform, then confirm it still sends a real 404 status code.
When someone follows a broken link or mistypes an address on your site, the server answers with a 404 error. If you have not set up your own 404 page, they see a generic message such as 'Not Found' or 'This page can't be found', often on a blank white screen with no logo, menu or way forward. A custom 404 page replaces that with a page in your own design that helps people find what they came for.
What people see without one
The default page depends on where your site is hosted. Apache and Nginx servers show a short grey or white message with the server name. Some platforms show a basic page with their own branding. Some themes show an empty page with only a heading. In every case, the visitor has no menu, no search and no hint about what to do next, so many simply close the tab.
Why it matters
- Lost visitors and sales: A person who lands on a dead end rarely goes hunting for the right page. A good 404 page with a menu, search box and links to your main pages keeps some of them.
- Trust: A bare server error looks unfinished. A friendly, branded message tells people the site is looked after.
- Search: Google does not penalise you for having 404 pages, as pages come and go. The real search risk is a 404 page that sends the wrong status code (see below), or broken pages that used to bring in visitors and now lead nowhere.
- Security tidiness: Default server error pages can show the server software name and version. A custom page keeps that detail off public view.
How to check if your site has the problem
These checks are free and take a few minutes.
- Type a made-up address into your browser, such as
yourdomain.com/this-page-does-not-exist-123. - Look at what appears. If it is a plain server message with no menu, header or footer, you have no custom 404 page.
- If it shows your homepage instead, or a page that looks normal, check the status code (next step). That can be a different problem.
- In Chrome, open Developer Tools (F12), go to the Network tab, reload the made-up address and click the first request. The status should say
404. If it says200, your site is showing an error page but telling search engines the page exists. This is called a soft 404. - If you use a terminal,
curl -I https://yourdomain.com/this-page-does-not-exist-123prints the status line at the top. - In Google Search Console, the Pages report can list URLs flagged as 'Soft 404'.
SiteMonday checks this as part of week 6, the broken links and 404 sweep, and the written report lists what it finds in a ranked fix list.
What a good 404 page contains
Keep it simple. You need:
- A clear, calm message such as 'We can't find that page'.
- Your normal header and menu, so the page feels like part of the site.
- A search box, if your site has search.
- Links to your homepage and two or three of your most useful pages (for a shop, categories or best sellers).
- A way to contact you.
Humour is fine if it suits your brand, but usefulness matters more than jokes.
How to fix it
The idea is the same everywhere: create a page or template for 'not found', tell your platform or server to use it, and make sure it returns status 404. Do not redirect every missing address to your homepage. Google treats that as a soft 404 and it confuses visitors.
Menu names change between versions and themes, so treat the places below as where things usually are.
- WordPress: Classic themes use a
404.phpfile in the theme folder. Block themes have a 404 template in the Site Editor under Appearance, then Editor, then Templates. Use a child theme so updates do not overwrite your work. See the WordPress guide. - Shopify: The 404 page is a theme template, usually
404.jsonor404.liquid. Open the theme editor, choose the 404 page from the page selector at the top, and edit the sections. - Webflow: Go to Pages, then Utility pages, and open the 404 page. Design it like any other page and publish.
- Netlify: Put a file named
404.htmlin the root of your published folder. Netlify serves it automatically with a 404 status for unknown addresses. - Next.js: In the App Router, add
app/not-found.js(or.tsx). In the Pages Router, addpages/404.js. - Apache: Create
404.htmlin your site root, then add this line to your.htaccessfile or server config:
ErrorDocument 404 /404.html
- Nginx: Create
404.html, then add this to your server block and reload Nginx:
error_page 404 /404.html;
location = /404.html {
internal;
}
If you use a local path like /404.html, the server keeps the 404 status. If you write a full web address instead (ErrorDocument 404 https://...), Apache sends a redirect, and the status is lost. Avoid that.
If you do not manage the server yourself, ask your host or developer to do the Apache or Nginx steps. Fixing is up to you or your developer, as SiteMonday only finds and explains problems.
How to confirm the fix worked
- Visit a made-up address again. You should see your new page with your header and menu.
- Check the status code in Developer Tools or with
curl -I. It must be404, not200or302. - Test a made-up address deep in a folder, such as
/blog/not-a-real-post, as some setups only handle top-level addresses. - Test on mobile.
- Make sure real pages still load normally.
If the page looks right but still returns 200, the cause is usually a redirect rule, a caching plugin or a theme that handles missing pages itself. Your developer can trace it.
How to stop it coming back
- Re-test the made-up address after a redesign, theme change, platform migration or server move. Custom 404 settings are often lost in these.
- Keep the page's links current. If your main pages change, update the links on the 404 page too.
- When you delete a page that had visitors or inbound links, redirect it to the closest relevant page instead of leaving a 404. See deleted pages with no redirect.
- Review broken links regularly. Our guide to the 404 page not found error explains how to find and fix the ones that matter.
- Because SiteMonday weeks follow the calendar, week 6 comes round each year, which gives you a regular reminder to re-check.
Step by step for your platform
- No custom 404 page on WordPress
- No custom 404 page on Shopify
- No custom 404 page on Next.js
- No custom 404 page on Netlify
- No custom 404 page on Apache
- No custom 404 page on Nginx
- No custom 404 page on Webflow
Questions
What is a soft 404?
A soft 404 is when a page that says 'not found' actually returns a success status (200) or redirects to another page. Search engines may treat it as a poor quality page, so your custom 404 page should return a real 404 status.
Should I redirect all 404 errors to my homepage?
No. It confuses visitors and Google treats it as a soft 404. Redirect only deleted pages that have a close replacement, and show your custom 404 page for everything else.
Does a 404 page hurt my SEO?
Not by itself. Pages come and go, and Google expects some 404s. Problems come from important pages that break without a redirect, or from error pages that return the wrong status code.
Do I need a developer to create a custom 404 page?
On WordPress, Shopify, Webflow and Netlify you can usually do it yourself in the editor or by adding a file. On Apache or Nginx you need to edit server settings, so ask your host or developer if unsure.
What should I put on a 404 page?
A short friendly message, your normal menu, a search box if you have one, and links to your homepage and most useful pages. Add contact details so people can report the broken link.