[Support request] H1 Tag Missing From Homepage

Home Forums Support [Support request] H1 Tag Missing From Homepage

Home Forums Support H1 Tag Missing From Homepage

Viewing 15 posts - 1 through 15 (of 17 total)
  • Author
    Posts
  • #1310228
    Jenny

    According to an SEO audit, I am missing an H1 tag on my homepage.
    I have used a logo and displayed the site tagline but have hidden the site title. The logo has my website title in it.
    I do not know how to fix it, I have tried looking for the answers, but I am not very techy.

    #1310369
    Leo
    Staff
    Customer Support

    Hi there,

    The best solution here would be to add a <h1> element using a header element:
    https://docs.generatepress.com/article/header-element-overview/
    https://docs.generatepress.com/article/page-hero-examples/
    https://docs.generatepress.com/article/how-to-create-a-page-hero/

    Let me know if this helps πŸ™‚

    #1310438
    Jenny

    Hi Leo,
    I looked at all the documentation you sent me, but I am not techy at all and I do not know where to begin. I do not want to start adding code as I am afraid of messing my site up.

    Is there a simple way that this can be done? If there is custom CSS to add I can do that if I knew where to add it.

    #1310558
    Leo
    Staff
    Customer Support

    CSS cannot turn something into an <h1>.

    The issue here is that there isn’t an element that is suitable to be <h1> on the home page. To be honest I don’t think it’s a big deal nowadays.

    If you really want to add an <h1>, then you can try creating a header element with something like this as the content:
    <h1>Blog</h1>

    #1335801
    Alicia

    H1 on the home page is the title of the Site. It is very important when it comes to screenreaders for accessibility.

    In fact, all of the Headings (h1, h2, h3, etc) need to be used hierarchically so the page makes sense to the sight impaired.

    Hiding the site title doesn’t remove it from the code nor screenreaders (hopefully). It’s still there. I can see it in my own code for my clients’ site. So, I’m imagining this will be picked up by Google when the site is indexed.

    Accessibility is becoming a BIG thing now, especially since the shelter in place. 98% of the web does not meet WCAG accessibility standards. And most of the court cases now are from blind users who found accessibility limitations.

    #1336506
    Tom
    Lead Developer
    Lead Developer

    Yes, by default your site title will be the H1 of your posts page.

    If you’re not using a site title, you can add an H1 to the posts page quite easily:

    1. Create a Hook Element: https://docs.generatepress.com/article/hooks-element-overview/
    2. Add your content:

    <div class="page-header">
        <h1>Your title here</h1>
    </div>

    3. Add it to the generate_before_main_content hook.

    4. Set the Display Rules to “Front Page” if your blog is your front page. If not, set it to “Blog”.

    That should do it πŸ™‚

    #1400354
    Cory

    I have that same problem. I added some code with the h1 tag for my blogroll but I don’t like where the heading “Blog” shows up on the page. Is there a way to change where the h1 tag shows up on the page?

    Any help with this would be greatly appreciated.

    Cory

    #1400437
    David
    Staff
    Customer Support

    Hi there,

    See this visual guide for where each of the different hooks is positioned:

    https://docs.generatepress.com/article/hooks-visual-guide/

    #1416946
    rajkumarsm

    Hi Tom & David,

    Facing the same issue “H1 Tag missing from Homepage”

    Here is my site URL “Software Testing Material

    Have added the above code and set the display rules as a blog. On the blog page, the H1 tag is appearing whereas the main problem still exists.

    H1 tag is missing on the homepage. I tried setting display rules as homepage. H1 (title) is displaying on the homepage but the site design is breaking. My homepage is designed using Elementor.

    Can I add any CSS for this to hide h1 in the front end for users?

    As of now, I left display rule to blog page.

    Is there any workaround for this.

    Thanks in advance.
    Rajkumar

    #1417313
    David
    Staff
    Customer Support

    Hi there,

    as your Home Page is built with Elementor you will need to add the H1 in your elementor content.

    #1417406
    Anil

    Hi

    I learned as follows

    add

    <h1 style="display:none">Your title here</h1>

    with hook on home page only.

    That’s it.

    2 years before I pointed out this issue, can any gp version would update this? I believe one line of option in customizer would solve this for newer users.

    #1705523
    acela

    Expanding on what Tom, Alicia, and Anil wrote above, I solved this by adding the following Elements hook for generate_before_main_content:

    <?php
    	$site_info = get_bloginfo( 'name' ) .": ". get_bloginfo( 'description' );
    
    	if ( get_query_var('paged') )
    		$page_number = ", Page ".get_query_var( 'paged' );
    	else
    		$page_number = "";
    
    	echo <<<EOT
    <header class="page-header" style="display:none;">
    	<h1 class="page-title">$site_info$page_number</h1>
    </header>
    EOT;
    ?>

    …with “Execute PHP” checked, and Display Rules > Location set to “Blog.”

    That added a <h1> tag to all pages on my site which had not previously included one.

    #1705653
    Alicia

    Nice, acela!

    #1750141
    imajn

    Thanks Anil. That worked for me out of all the coding mentioned.

    #1750142
    Elvin
    Staff
    Customer Support

    Watch out on where you put it on. It may cause duplicate h1 and that’s another error flagged. There should be one and only 1. Glad you got it sorted. πŸ™‚

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