Remove the Product reviews tab from the customer section of the admin panel using Magento 2 by layout XML.
When you remove the product reviews tab, it will be removed from the left sidebar of the Customer edit section in the admin panel.
Reviews tab contains the grid of all the items in which the customer has given a review from the store.
Product reviews section coming through customer_form.xml of UI components. Check the declaration of the Reviews tab from the Magento_Review/view/base/ui_component/customer_form.xml
By creating a new customer_index_edit.xml file in the adminhtml view of the module.
I have just taken Jesadiya_Reviews as the module name.
app/code/Jesadiya/Reviews/view/adminhtml/layout/customer_index_edit.xml
<?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_edit_tab_view"> <referenceBlock name="reviews" remove="true"/> </referenceBlock> </body> </page>
Main XML code is the,
<referenceBlock name=”reviews” remove=”true” /> just pass remove as true to the revies reference block delete tabs from the customer section.
This is the simple way to delete the entire product reviews section from the Customer edit page.