How To Remove SKU from Product Page in Magento 2
SKU stands for Stock Keeping Unit
Magento 2 uses SKU as a unique identification code in alphanumeric format to track the inventory of the store. SKU is helpful to create orders, shipping, and working with inventory.
The default Magento 2 displays the SKU in the frontend. However, it is unnecessary to display it to visitors.
Any unnecessary details only divert the visitors from the purchase. The non-technical users need not deal with the alphanumeric codes while shopping.
Also, it is only wise to hide SKU from the product page in Magento 2 for virtual products like software, services, support, etc.
A clean product page with only the essential product details and attractive design is the key to conversion. Hence, to overcome the default behavior and remove SKU from product page in Magento 2, follow the below solution:
Method To Remove SKU from Product Page in Magento 2:
Create catalog_product_view.xml file at Vendor/Test/view/frontend/layout
1 2 3 4 5 6 |
<?xml version="1.0"?> <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="product.info.sku" remove="true" /> </body> </page> |
That’s all to hide SKU from the product page in Magento 2.
Any doubts? Please mention them in the Comments section below and I’d be glad to help you out.
Do share the solution with fellow developers via social media.
Thanks.
Sanjay Jethva
Sanjay is the co-founder and CTO of Meetanshi with hands-on expertise with Magento since 2011. He specializes in complex development, integrations, extensions, and customizations. Sanjay is one the top 50 contributor to the Magento community and is recognized by Adobe.
His passion for Magento 2 and Shopify solutions has made him a trusted source for businesses seeking to optimize their online stores. He loves sharing technical solutions related to Magento 2 & Shopify.
4 Comments
Is there a way to hide the SKU if the product is a configurable SKU but show simple SKU’s on other pages for simple SKU’s?
Hey Martin Leeney,
Try to use catalog_product_view_type_configurable.xml instead of catalog_product_view.xml.
Thank You!
Vendor/Test/view/frontend/layout
/test what do you mean test????
Hello,
It is the custom extension name and not the Magento core vendor.
Check this format: [CompanyName]/[ModuleName]
Thank you.