Custom 404 Not Found Page for Magento 2
Replaces the default Magento 2 404 content with your own heading and message, a product search box, home and back buttons and links to your top-level categories. The page keeps its HTTP 404 status.
- Free
- Themes listed: Hyvä + Luma
composer require mage2kishan/module-not-found-page
- Package requirementsRead the source documentation
- Developer profileView Upwork profile
- Themes listedHyvä + Luma
- PHP versions listed8.1, 8.2, 8.3, 8.4
- Installation questionsDiscuss your store setup
What it does for your store
The main features, as listed in the module documentation.
-
Search from the 404 page
A search form that submits to Magento's catalog search so visitors can look for what they wanted.
-
Top-level category links
Up to six active top-level categories from the store's root category, in menu position order.
-
Your own heading and message
Set the heading and message in the admin, per default, website or store view scope.
-
Home and back buttons
Back to Homepage and Go Back, which falls back to the home page when the browser has no history.
-
Keeps the 404 status
Only the content area changes; the response stays HTTP 404 with a noindex, follow robots tag.
Installation
Example commands from the Magento root. Follow the package instructions and your staging and deployment process.
- 1Check the releaseMatch Magento, PHP, theme and dependency requirements.
- 2Install on stagingReview Composer changes and follow the package instructions.
- 3Configure and verifyUse the documented settings and test the affected features.
$ composer require mage2kishan/module-not-found-page $ bin/magento setup:upgrade $ bin/magento setup:di:compile $ bin/magento setup:static-content:deploy -f $ bin/magento cache:clean
Listed requirements
These are the details supplied in this listing. Confirm the selected release supports your Magento edition, PHP and storefront.
| Magento versions listed | 2.4.6, 2.4.7, 2.4.8 |
|---|---|
| PHP versions listed | 8.1, 8.2, 8.3, 8.4 |
| Themes listed | Hyvä, Luma |
| Composer package | mage2kishan/module-not-found-page |
Documentation
Product details and setup guidance. Check the package repository for release-specific instructions.
A 404 page that points visitors back into the store
Custom 404 Not Found Page for Magento 2 changes what a visitor sees when a link is dead. Instead of the default CMS text, the no-route page shows a heading and message you set in the admin, a product search box, buttons back to the home page or the previous page, and links to the store's top-level categories.
Only the content area changes. The store header and footer stay in place and the response keeps Magento's HTTP 404 status, so search engines still see a missing page while shoppers get a way forward.
What the page shows
- A heading and an optional message under it. Leave the message empty to hide it.
- A search form that submits to Magento's catalog search at
catalogsearch/result. - A Back to Homepage button and a Go Back button. Go Back opens the previous page, or the home page when the browser has no history.
- A Browse Categories section with up to six direct children of the store's root category that are active and included in the menu, in position order. The section is left out when none qualify.
- An optional Need help line with a mailto link to an address you enter. It stays hidden while the address is empty or not a valid email address.
Settings per store view
All settings live under Stores, Configuration, Panth Extensions, 404 Not Found Page, and each one can be set at default, website or store view scope. A store view can have its own heading, message, contact address and section toggles. The Show Popular Links setting controls the Browse Categories section; there is no separate list of custom links.
When Enable Custom 404 Page is set to No, Magento's own 404 CMS page is shown unchanged. Clean the layout and full page caches after changing that setting.
How it hooks in
The module does not replace the no-route controller. An observer on layout_load_before adds the panth_notfound_custom layout handle to the cms_noroute_index page while the module is enabled. That handle removes the default 404 content and adds the module block. The layout also sets the page title to "404 - Page Not Found" and a NOINDEX,FOLLOW robots meta tag; both can be changed in a theme override of that layout file.
The page uses one template with inline styles and no JavaScript library, and the package README lists Hyvä and Luma as supported themes. To change the markup, override Panth_NotFoundPage::notfound.phtml in your theme. Check the result with your own header, footer and theme styles on staging.
Accessibility details
The content sits in a main landmark with the theme skip-link target, the search field has an accessible name, the category links are in a labelled navigation region, keyboard focus is visible and buttons have touch targets of at least 44 pixels on phones.
Requirements and install
The package README lists Magento Open Source and Adobe Commerce 2.4.4 to 2.4.8 and PHP 8.1 to 8.4. It requires mage2kishan/module-core, which Composer installs. The module adds no database tables, cron jobs or console commands, and its styles are inline, so no static content deployment is needed for it.
Install it with composer require mage2kishan/module-not-found-page, enable Panth_Core and Panth_NotFoundPage, run setup:upgrade, and then open an address on your store that does not exist to see the page. Read the package README and the user guide for the full settings table and troubleshooting.
License
Free and open source under the MIT License.
Developer notes
These names are from release 1.0.15 of the package.
- Namespace
Panth\NotFoundPage. - Observer
Panth\NotFoundPage\Observer\AddCustomPageHandleadds thepanth_notfound_customlayout handle. - Block
panth.notfound.page, classPanth\NotFoundPage\Block\NotFound. - Settings are read through
Panth\NotFoundPage\Helper\Data.
| Module Category | Theme & UI |
|---|---|
| Best For | All Sizes |
Changelog
-
1.0.15, 2026-10-30
- Released under the MIT License: this module is free and open-source software.
-
1.0.14, 2026-10-03
- The 404 page now renders inside a main landmark with the #contentarea skip-link target, so the theme "Skip to Content" link works and screen readers find the main region on Hyvä and Luma.
- The search field has an accessible name, the form is marked as a search region, decorative icons and the large 404 numeral are hidden from assistive technology, and buttons, category links and the contact link show a visible keyboard focus outline.
- "Browse Categories" is now an h2 inside a labelled navigation region instead of an h3 that skipped a heading level.
- Touch targets are at least 44px: the Back to Homepage and Go Back buttons on every width and the category links on phones and tablets. The conflicting 640px button rule that padded the round mobile buttons was removed.
FAQ
Does this module override Magento's `cms/noroute/index` controller?
No. An observer on layout_load_before adds the panth_notfound_custom layout handle to the no-route page while the module is enabled. That handle removes the default 404 content and adds the module block. The controller itself is not changed.
Will the page still return HTTP 404?
Yes. The module does not change the response status, it only changes what is rendered inside the 404 response.
Can I use different headings for different languages?
Yes. The heading and message can be set per store view, so each language store view can show its own text. The heading and message are printed as entered and are not passed through translation CSV files; the fixed labels such as Search and Go Back are translatable.
Does it work with Hyvä themes?
The package README lists Hyvä and Luma as supported themes. The page uses one template with inline styles and no JavaScript library, and it does not touch checkout. Check it with your Hyvä theme version and header on staging.
Does it work on Adobe Commerce Cloud?
The package documentation does not name Adobe Commerce Cloud. The module adds no database tables, cron jobs, console commands or file writes, and its README lists Adobe Commerce 2.4.4 to 2.4.8. Test it on a staging environment before deploying.
Can I customize the template further?
Yes. Override Panth_NotFoundPage::notfound.phtml in your theme, for example app/design/frontend/Vendor/theme/Panth_NotFoundPage/templates/notfound.phtml. The page title and robots tag come from the layout file panth_notfound_custom.xml, which can also be overridden.
Does this conflict with other 404 or URL rewrite extensions?
The module only adds a layout handle to the no-route page. It does not intercept routing, redirects or URL rewrites, so a redirect that matches a URL runs before the 404 page is reached. Test it together with any other module that changes the 404 page layout.
Is a module dependency required?
Yes, mage2kishan/module-core (free, required for every Panth extension). Composer pulls it in automatically.
Questions before you install?
Send me your composer.json and I will check for conflicts first. Free. Installation is +$45, custom work is quoted first.