Is there any way to show any message for disable product at product details page?

When i search product name in google, it gives product URL in search result.

When product is disable at that time it gives 404 page not found, so i want to show disable message for that disable product instead of 404 page not found.


By default disable products does not show at fronted,its mean there is no way to display message at product detail page while it is not showing up/disabled. However you can create url rewrite for old/disable products to custom cms page to display any message about product through marketing > url rewrite

  • i don't want to redirect to cms page, i want to show that page instead of 404 page not found – Jimit Bhavsar Nov 2 '18 at 13:20
  • Aright! we have two options in magento disable product and out of stock product. when we disable a product it does not appear on frontend,site search nor category listing.However if the product set to "out of stock" than product will not appear frontend,site search or category listing , but still that product have working product page if shopper has the direct product url he can browse that page , he would not able to add that product to cart due to out of stock flag with product. – Muhammad Ayaz Nov 2 '18 at 13:54
  • For cusom message display copy vendor/module-catalog-inventory/i18n/en_US.csv into your theme app/design/frontend/<your_vendor_name>/<your_theme_name>/i18n/en_US.csv and add your translation to it: what ever message you want to display on the page – Muhammad Ayaz Nov 2 '18 at 13:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.