Documentation
Feedback
Guides
Storefront Development

Storefront Development
Store FrameworkRoutingCustomizing your 404 page
Customizing your 404 page

Learn how to customize your store's 404 error page using Store Framework.

This guide provides instructions for customizing your store's 404 pages using the VTEX IO Store Framework. With flexible blocks and configurations, you can create a custom error page that aligns with your brand and helps users seamlessly navigate back to key areas of your site.

Instructions

To customize 404 pages, follow the steps below:

  1. Open the terminal and switch to a development workspace.

  2. Open your Store Theme using your preferred code editor.

  3. In the product or search template (store.product or store.search), add and configure the store.not-found#product or store.not-found#search block, respectively. See below an example of a store.not-found#product configuration for a product template:


    _11
    "store.not-found#product": {
    _11
    "blocks": ["rich-text#not-found"]
    _11
    },
    _11
    "rich-text#not-found": {
    _11
    "props": {
    _11
    "textAlignment": "CENTER",
    _11
    "textPosition": "CENTER",
    _11
    "text": "**PAGE NOT FOUND**",
    _11
    "font": "t-heading-1"
    _11
    }
    _11
    }

The store.not-found blocks will only be rendered when the server returns a 404 error. The child block will be displayed to users in such cases.

  1. Save your changes and run vtex link in your terminal to preview the updated 404 page:

{"base64":"  ","img":{"width":2878,"height":1492,"type":"png","mime":"image/png","wUnits":"px","hUnits":"px","length":169303,"url":"https://cdn.jsdelivr.net/gh/vtexdocs/dev-portal-content@main/images/vtex-io-documentation-enabling-404-pages-1.png"}}

  1. Once you're satisfied with the changes, publish your new theme version.
Contributors
1
Photo of the contributor
+ 1 contributors
Was this helpful?
Yes
No
Suggest Edits (GitHub)
See also
Enabling 404 pages for invalid single Segment paths
Guides
Contributors
1
Photo of the contributor
+ 1 contributors
On this page