15

I´m trying to remove the home page main title on my custom theme (wich is running on top of luma theme).

I´ve tried to add the usual tag to remove, as follows (and as it was already answered here), full content of my current cms_index_index.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="page.main.title" remove="true"/>
    </body>
</page>

I´ve already tried other aproaches such as

<referenceBlock name="page.main.title" display="false"/>

And

<referenceBlock name="cms_page" display="false"/>

With no success either. Cache is being cleaned and files deployed. The cms_index_index.xml file i´m working in is located on folder

/app/design/frontend/<vendor>/<theme>/Magento_Cms/layout

What other options do i have? Why isn´t this aproach working?

1
  • 1
    Your code is definitely ok (the first code you tried) I've just tested it and it works fine on my side. I reckon your XML is not being picked up for some reason. Did you check the logs ? Oct 27, 2016 at 13:38

7 Answers 7

36

have you tried in cms_index_index.xml something like this?

<?xml version="1.0"?>
<!--
/**
 * Copyright © 2016 Magento. All rights reserved.
 * See COPYING.txt for license details.
 */
-->
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceBlock name="page.main.title" remove="true" />
    </body>
</page>
2
  • 1
    Works fine for me Mar 22, 2017 at 8:54
  • Yup, this is the way to go. If you want to remove it on a category page, for example you put this in catalog_category_view.xml file. And you can omit the layout attribute inside the <page> element.
    – Zankar
    Apr 9, 2019 at 7:43
11

For all other Pages create cms_page_view.xml instead cms_index_index.xml

/app/design/frontend/<vendor>/<theme>/Magento_Cms/layout/cms_page_view.xml

And add same code you have used for cms_index_index.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="page.main.title" remove="true"/>
    </body>
</page>
5
  • Login to Admin
  • Goto Content->Element: pages->
  • Edit HomePage
  • Select Content
  • Remove Contet Heading and Save.
1
  • I think this is the first thing to try. Because I was looking exactly for the same thing and I almost tried the code part. But with this, it was fair enough.
    – PauGNU
    Mar 31, 2020 at 9:28
2
  • Check cms home page. content-> pages-> home page
  • than open that page and check that content heading is blank or not.

  • If it is not than remove heading. Now its removed form your front page

0

If your certain your XML is valid but not picked up by Magento, make sure that you check the table "theme" inside your Magento database.

The column "type" should have the value 0 (zero), for your theme.

If it is set to 1 (virtual) it will not pickup the overwrites that you defined inside your app/design custom theme folder.

Once you set it to 0, make sure that you clear all the cache, pub/static/frontend, var/view_preprocessed and re-check if your changes are now working.

0

Open homepage from Admin
Goto >> Design >> Layout Update XML add line

<referenceBlock name="page.main.title" remove="true"/>
1
  • mag2.2.2 give Please correct the XML data and try again. Element 'referenceBlock': This element is not expected. Expected is one of ( referenceContainer, container, update, move, head, body ). Line: 6 Oct 29, 2019 at 9:12
0

i) Go to Admin=>content=>element=>pages ii) select page=>edit=>changes:- page titleenter image description here

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.