Hi I am having multi website, I want to remove entire footer from website id 3. here is my xml file


here added the code.

  <referenceContainer name="footer-container" remove="true" />

This is removing footer from all websites. How to make it for only website Id 3. Can I Get help? Thank you in advance

1 Answer 1


You can use this below process:

Create a unique layout handle for that website only. Like website_3 and use the observer event layout_load_before

Observer code

class LayoutLoadBefore implements \Magento\Framework\Event\ObserverInterface {

     * @var \Magento\Store\Model\StoreManagerInterface
    private $storeManager;

    public function __construct(
        \Magento\Store\Model\StoreManagerInterface $storeManager
    ) {
        $this->storeManager = $storeManager;

    public function execute(\Magento\Framework\Event\Observer $observer)
       if ($this->storeManager->getStore()->getWebsiteId() == 3) {
           $layout = $observer->getEvent()->getLayout();

           $handlecode ='website_'.$this->storeManager->getStore()->getWebsiteId();

        return $this;


Layout code for that file

app/code/{Vendorname}/{Module Name}/view/frontend/layout/website_3.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">
        <referenceContainer name="footer-container" remove="true" />
  • this is working like charm. Thank you so much for answer @Ritesh Santra Commented Aug 11, 2020 at 7:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.