Black Friday Sale! Get $20 off GP Premium, $40 off our new Lifetime license, and 45% off license renewals/extensions! Learn more

[Support request] Need to remove header h1 tag from the html

Home Forums Support Need to remove header h1 tag from the html

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #379211
    Nathaniel

    Hello,
    I have a home page that has a header using a page builder. This header has an <h1> tag in it. H1 tags are important for search engines to help them understand the main focus of the page. However, when I disabled the default theme header, it only hid the theme header in css. It didn’t remove it from the html.

    Is there any way to disable the header so that the default theme header elements are not even sent to the browser in the html?

    If you need to look at my page, please go to https://www.myseostrategy.com and view the page source. Then do a search in the source for “h1” and you will see 2. One with the word “Home” and another with the words “My SEO Strategy”.

    Thank you,

    #379221
    Leo
    Staff
    Customer Support
    #380475
    Nathaniel

    Ok, but is it possible to do it for just one page? I only want this removed from pages where i click the “disable header” option. Is that possible without a whole ton of effort?

    #380595
    Leo
    Staff
    Customer Support

    Yup for sure. Just the static home page?

    Try this:

    add_action( 'after_setup_theme','tu_remove_header' );
    function tu_remove_header() {
        if ( is_front_page() ) {
            remove_action( 'generate_header','generate_construct_header' );
        }
    }

    Adding PHP: https://docs.generatepress.com/article/adding-php/

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.