Change the response code

Show a 404, 410, 451, or 503 response and a message page instead of the original page.

Instead of the original page, show the response code and page you choose right away. Without deleting the page on your origin server, you can tell search engines that it's gone or under maintenance.

 

When to use it

  • Product pages that are no longer for sale keep showing up in search
  • You can't delete a page on the origin but want it out of search results
  • You want to show a notice during maintenance while keeping your search rankings

 

How to set it up

  1. In Search & AI visibility settings > Per-page SEO, click Add rule and choose the pages and path.
  2. In the Response code (status) field, choose Status code, then pick a code.
  3. If needed, put the HTML visitors should see in Page to show (HTML) and save. If you leave it empty, a default page is shown.
Response code Choose it when
404 Not Found The page is gone. It slowly disappears from search results
410 Gone The page won't come back. It disappears faster than 404
451 Unavailable For Legal Reasons The page can't be shown for legal reasons
503 Service Unavailable The page is under maintenance. Search rankings are kept

If you choose 503, you can also set Retry after (Retry-After). This tells search engines when to come back.

 

Example

To quickly remove a group of sold-out products from search:

  • Pages: Some pages, path /product/old-collection*
  • Response code: 410 Gone
  • Page to show: a message such as "This product is no longer available. See new products" with a link

 

Good to know

  • None in the response code field follows the rule from the wider scope, and Use origin shows the origin's response as is.
  • While a response code is on, other settings in the same rule don't apply. Their values are kept.
  • A rule can have either a redirect or a response code, not both.
  • To exclude a specific path from a response code set on a wider scope, turn on Bypass inherited rules on this path in that path's rule.
  • Whether 404, 410, and 451 pages are cached is set under error page cache in Set up the page cache.