Choose a way to do this check
Browser Network
- Request one known removed URL and one current product URL in a fresh session.
- Check both the visible page and its initial response status. They should describe the same state.
Screaming Frog
- Filter Response Codes for Client Error and inspect Inlinks.
- Keep legitimate 404 or 410 responses. Fix live links still leading to them.
Header evidence
- Paste the response for a removed URL alongside a healthy control.
- Check status independently of the text shown in the error template.
1. Decide whether the URL has a replacement
If the same content moved, a permanent redirect to its closest equivalent is usually the useful response. A retired product with no equivalent can return 404 or 410. Keep a valid page live if it still has something useful to offer, such as an instruction manual or a restocking option. A product that is temporarily out of stock does not need an error response just because it cannot be bought today.
HTTP 404 means no current representation was found or the server is unwilling to disclose one. HTTP 410 indicates the resource is no longer available and the condition is likely permanent. For Google, both are 4xx responses that can lead to exclusion from the index. Choose the status that describes the page accurately rather than trying to predict how quickly search will update.
2. Set the status before rendering the error page
Set the status in the layer that knows the outcome. This may be the application router, a CMS publishing rule or an exact server rule. The PHP example below is an error handler for a path the router has already identified as gone. It should run before output. Change 410 to 404 for a missing URL or an unknown route.
<?php
http_response_code(410);
require __DIR__ . '/views/gone.php';
exit;Use the same accessible layout as the rest of the site. Explain what happened and link to a relevant category, search or contact page where that helps. Keep the browser at the removed address so the response tells clients what happened to that URL. A redirect to a generic error URL makes the original status harder to diagnose.
3. Verify a real GET through the public edge
Test the exact retired URL with no automatic redirects first. Test a made-up URL and a healthy page from the same template. Check that the response is an honest error on the first two, and that the healthy route still returns the expected content.
for path in /products/discontinued-lamp/ /made-up-test/ /products/current-lamp/; do
curl -sS -o /dev/null -w '%{http_code} %{url_effective}\n' \
"https://www.example.com$path"
doneIf the application shows an error page under a 200 response, inspect fallback routing. A React or CMS catch-all may be sending the same response even when no content exists. If staging returns the right status and production does not, compare edge caching and custom error settings. Clear the intended cached response if your deployment process requires it.
4. Clean up links and monitor the outcome
Remove the gone URL from the XML sitemap and update internal links that still send people there. Keep a dated record for any URL with valuable external links or traffic. Verify that a genuine equivalent was not missed before removing it. If the release affects working pages, restore the prior routing configuration and retest both the removed URL and known healthy URLs.
Technical references
Frequently asked questions
Does a custom error page need to look blank?
No. It can have navigation and useful suggestions. Its initial HTTP response needs to carry the intended error status.
Should I redirect all 404s to the homepage?
Redirect a URL only when there is a useful replacement. An unrelated homepage does not resolve the original request.
Should I remove the URL from the sitemap?
Yes, when it should no longer be indexed. Update any links still pointing to it.
Is a 410 required to remove a URL from Google?
No. A genuine 404 is also appropriate when the resource is unavailable.
Written by Richie Aubin
Published
