• Resolved charlotte2311

    (@charlotte2311)


    Hello,
    I’m French so I hope my English translation will be understandable as I’m using technical terms!
    I’m doing all the SEO for my site and it seems that the main menu (the one under the logo) is a <h2> tag. This is very annoying because it tells me that all the pages on my site have an <h2> in front of an <h1>. How can I change this title tag for the main menu? I would be very grateful if you could help me !
    Have a good day

    The page I need help with: [log in to see the link]

Viewing 7 replies - 1 through 7 (of 7 total)
  • Hello @charlotte2311,

    The main navigation menu does not have the <h2> tag. The title of blogs on the blog page contains <h2> tags and the title of the single blog post page and the Page has the <h1> tag.
    There is no customization option to change the title’s tags but you can create and use a child theme to modify the template and change the tags.

    Thread Starter charlotte2311

    (@charlotte2311)

    Hello, thank you for your answer. What I don’t understand is that all the title tag detection sites tell me that the main navigation is in <h2> (on all pages). Maybe it would be another header element in this case, don’t you think so?
    I can’t attach a screenshot so I invite you to visit this title tag analysis site: https://www.webrankinfo.com/outils/balises-h1-h6.php
    and copy and paste my URL : https://illustraworld.com
    –> it says that “main navigation” is in h2.
    Do you know why ?

    Hello @charlotte2311,

    Though the tag analysis sites show 2 <h2> tags in Main Navigation you can inspect and see that neither the Main Navigation nor the Footer Navigations has any Heading tags in them.

    The 2 <h2> tags in navigation are for screen-reader and are visually hidden.

    Thread Starter charlotte2311

    (@charlotte2311)

    Thanks @bagdesaurabh69 . Indeed, I have just inspected the element and the h2 that causes the problem is in the body but is placed at the very top of the screen I think, hence the problem.
    Here is the line in question: <h2 class=”screen-reader-text”>Main Navigation</h2>
    Do you know what it is?
    It is indeed in the body when you inspect the element but this line is below the : `<nav id=”site-navigation” class=”main-navigation” role=”navigation” itemprop=”name” aria-label=”Main Menu”> line which is linked to the menu. So it’s like the menu is in the body?
    This is the “block” that is the problem :

    <nav id="site-navigation" class="main-navigation" role="navigation" itemprop="name" aria-label="Main Menu">
    	<h2 class="screen-reader-text">Main Navigation</h2>
    	<div class="main-navigation-wrapper">
    				<button class="menu-toggle" aria-controls="header-menu" aria-expanded="false"><i class="icon-bars"></i><span class="hamburger-menu-label"></span><span class="screen-reader-text">Menu</span></button>
    
    		<ul id="header-menu" class="menu nav-menu" aria-expanded="false"><li id="menu-item-17" class="menu-item menu-item-type-custom menu-item-object-custom current-menu-item current_page_item menu-item-home menu-item-17"><a href="https://illustraworld.com/" aria-current="page">ACCUEIL</a></li>
    <li id="menu-item-54" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-54"><a href="https://illustraworld.com/illustration-famille-personnalise">BOUTIQUE</a></li>
    <li id="menu-item-8907" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-8907"><a href="https://illustraworld.com/portrait-dessin-personnalise">OFFRE PRO</a></li>
    <li id="menu-item-55" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-55"><a href="https://illustraworld.com/a-propos">à PROPOS</a></li>
    <li id="menu-item-56" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-56"><a href="https://illustraworld.com/illustration-portrait-personnalise">CONTACT</a></li>
    <li class="menu-item wpmenucartli wpmenucart-display-right menu-item empty-wpmenucart" id="wpmenucartli"><a class="wpmenucart-contents empty-wpmenucart" style="display:none">&nbsp;</a></li></ul>	</div>
    </nav>
    Thread Starter charlotte2311

    (@charlotte2311)

    @bagdesaurabh69 Thank you for your answer. And so the Google robot does not take into account these h2 tags for SEO?

    Hello @charlotte2311,

    As mentioned in my previous reply that is for screen-reader and is visually hidden.
    This is used by those who have difficulty reading or are visually impaired can use a screen-reader or skip links to ensure keyboard navigation visibility when the link gets focused.
    No, it does not have a link so that won’t be crawled. You can use a robots.txt file to tell search engine crawlers which URLs the crawler can access on your site.

    Thread Starter charlotte2311

    (@charlotte2311)

    Thank you very much ! Have a good day

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘headings in main navigation’ is closed to new replies.