Removing the 'My Product Reviews' Tab in Magento 2

Removing the 'My Product Reviews' Tab in Magento 2
If you're looking to streamline the customer dashboard in Magento 2, removing the 'My Product Reviews' tab can help. This tab typically appears in the left sidebar of the customer dashboard, showcasing all product reviews submitted by the customer.
Table Of Content
Removing the 'My Product Reviews' Tab in Magento 2
In Magento 2, the 'My Product Reviews' tab appears in the customer's dashboard sidebar, displaying all product reviews submitted by the customer. If you prefer to remove this tab, follow these steps:
Create or Modify the customer_account.xml File:
- Navigate to your theme's layout directory:
app/design/frontend/{VendorName}/{ThemeName}/Magento_Review/view/frontend/layout/
. - If the
customer_account.xml
file doesn't exist, create it. - Add the following XML code to remove the 'My Product Reviews' tab:
<?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="customer-account-navigation-product-reviews-link" remove="true"/>
</body>
</page>
This code references the block responsible for the 'My Product Reviews' link and removes it.
Clear the Cache:
- After making changes to the XML file, clear the Magento cache to apply the modifications:
php bin/magento cache:clean
By following these steps, the 'My Product Reviews' tab will be removed from the customer's dashboard sidebar.
Additional Considerations
- Disabling the Review Module: If you wish to disable the entire review functionality, it's advisable to hide it using XML rather than disabling the module, as disabling can cause errors due to module dependencies.
- Removing Reviews from Product Pages: To remove the reviews tab from product detail pages, you can add the following code to your theme's
catalog_product_view.xml
file:
<?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.details">
<referenceBlock name="reviews.tab" remove="true"/>
</referenceBlock>
</body>
</page>
This code removes the reviews tab from the product detail page.
Always ensure to back up your files before making changes and test the modifications in a staging environment to prevent any disruptions to your live site.
Tip
To enhance your eCommerce store’s performance with Magento, focus on optimizing site speed by utilizing Emmo themes and extensions. These tools are designed for efficiency, ensuring your website loads quickly and provides a smooth user experience. Start leveraging Emmo's powerful solutions today to boost customer satisfaction and drive sales!
FAQs
How Can I Remove the 'My Product Reviews' Tab in Magento 2?
You can remove the 'My Product Reviews' tab from the customer dashboard sidebar by modifying the customer_account.xml
file and using the <referenceBlock name="customer-account-navigation-product-reviews-link" remove="true"/>
node.
Where Is the customer_account.xml File Located?
The customer_account.xml
file is typically found at the following path:
app/design/frontend/{VendorName}/{ThemeName}/Magento_Review/view/frontend/layout/customer_account.xml
What Is an Example of Removing the 'My Product Reviews' Tab?
To remove the 'My Product Reviews' tab, add the following code inside customer_account.xml
:
<referenceBlock name="customer-account-navigation-product-reviews-link" remove="true"/>
What Happens After I Remove the 'My Product Reviews' Tab?
Once you remove the tab using the XML file, it will no longer appear in the customer dashboard sidebar. However, the reviews section itself will still exist; it just won't be accessible from the sidebar.
Do I Need to Clear the Cache After Removing the Tab?
Yes, after modifying the customer_account.xml
file, you should clear the Magento cache to apply the changes:
php bin/magento cache:clean
Can I Remove Other Customer Navigation Links?
Yes, you can remove any customer navigation links by using a similar approach. For example, to remove the 'My Account' or 'My Orders' links, just reference their block names and set remove="true"
in your customer_account.xml
file.