How to Disable Magento 2 Reviews And Ratings
Customer reviews reflect the product or service assessment that encourages potential visitors for conversions.
However, for some reason, the store owner may want to disable Magento 2 reviews and ratings.
The older versions offered an option in the admin panel to disable them. But with Magento 2.2.x versions and above, that option is not available and hence here’s the solution for the same.
Also, it is not advisable to disable the Magento_Review module as it causes errors. A better idea is to hide it with XML as shown below:
Steps to Disable Magento 2 Reviews And Ratings:
- Add the below code at app/design/frontend/theme_folder/theme_name/Magento_Theme/layout/default.xml
123456789<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"><body><referenceBlock name="reviews.tab" remove="true" /><referenceBlock name="product.review.form" remove="true" /><referenceBlock name="product.info.review" remove="true" /><referenceBlock name="customer-account-navigation-product-reviews-link" remove="true" /><referenceBlock name="review_view" remove="true" /></body></page>
Note: If you don’t have a theme, create child theme in Magento 2. After that, create file app/design/frontend/theme_folder/theme_name/Magento_Theme/layout/default.xml and add the above code in default.xml file.
That’s it.
The above method works with all Magento 2 versions.
Feel free to post your doubts on the Comments section below and I’d be happy to help.
Do share the solution with fellow developers via social media.
P.S. – If you get impressed with the benefits of customer reviews in E-commerce, you can check our tutorial to allow guests to write reviews in Magento 2!
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.
2 Comments
Hello, I have tried this with 2.4.1 and it does not work and results in an error like so…
1 exception(s):
Exception #0 (OutOfBoundsException): The element with the “reviews.tab” ID wasn’t found. Verify the ID and try again.
Exception #0 (OutOfBoundsException): The element with the “reviews.tab” ID wasn’t found. Verify the ID and try again.
Hello Ciara,
We’ve checked in Magento 2.4.2 and have not found any issue.
The third-party theme might be there in your store and the issue may persist because of third-party theme confliction.
The reference might be removed or changed from the review tab
Thank You