magento2 – Remove particular block from specific store view

We can’t remove blocks in the layout file based on store view. Please refer the below core file on how to remove blocks programmatically based on conditions. We need to create after plugin for your controller then remove block in afterExecute method based on your condition.

Core example:

vendor/magento/module-inventory-in-store-pickup-shipping-admin-ui/etc/adminhtml/di.xml

<type name="MagentoShippingControllerAdminhtmlOrderShipmentView">
    <plugin name="shipment_tracking" type="MagentoInventoryInStorePickupShippingAdminUiPluginShippingControllerOrderShipmentViewShipmentTrackingPlugin"/>
</type>

Create di.xml in your extension as like above and change your controller in the above plugin.

vendor/magento/module-inventory-in-store-pickup-shipping-admin-ui/Plugin/Shipping/Controller/Order/Shipment/View/ShipmentTrackingPlugin.php

public function afterExecute(View $subject, $result)
{
    if ($result instanceof Page) {
        
        if (write_your_condition_here_to_check_store_view) {
            $result->getLayout()->unsetElement('customer-sold');
        }
    }

    return $result;
}

Create plugin class in your extension as like above file and apply your condition.