• Resolved vickigarside

    (@vickigarside)


    Hi!

    I did an SEO audit on the site and it flagged that my Site Title has the H1 tag (tagline has the h2 tag) which is causing all my posts to have a duplicate H1 tag when I add a title to any page or post.

    I found the below code online which was meant to remove the H1 tag and replace with H3 so as not to interfere with the H1 tag – but when I check the page via chromes ‘page source’ function, the title is still showing as H1.

    Do I require different code for the SELA theme specifically?

    Thank you

    Following code found on: https://www.ads-software.com/support/topic/remove-site-title-h1-tag-from-pages/
    add_filter( ‘tc_site_title_tag’, ‘my_title_tag’ );

    function my_title_tag($content) {
    return “h2”; //Change to h3 if needed
    }

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hi @vickigarside!

    Having multiple H1 tags on a page used to be a bad idea – but it’s actually valid under HTML5, and not something you really need to alter ??

    If you do want to change it, and you’re having trouble getting that filter to work, you might want to put a copy of the paren theme’s functions.php file into your child theme, and change the HTML directly.

    Yikes!

    you might want to put a copy of the paren theme’s functions.php file into your child theme, and change the HTML directly.

    That’s a terrible typo on my part – do not do that, sorry!

    I meant to say make a copy of the parent theme’s header.php file, copying functions.php would get you all sorts of errors.

    Thread Starter vickigarside

    (@vickigarside)

    Thanks for letting me know multiple h1 tags don’t matter – I was freaking out when I ran 2 different seo audits and both flagged the same issue.

    I think I’ll just leave everything as is.. ??

    GaryManners

    (@garymanners)

    I would agree that having two H1 tags, one in the site title and one in the page title is not a horrible thing SEO-wise, but there are some SEO folks who do advise against it, such as Yoast. What they typically recommend is that the homepage or front page your site title would be a H1 but on all other pages and posts it should be a H2 or H3 and let the page/post name be the H1.
    The SEO community seems a little split on this issue so I take that to mean that it’s not that big of a deal.
    I see the logic of doing this but it seems to be real fidgety fine tuning, plenty more SEO could be done elsewhere and be more effective.

    If you do want to pursue this I would as Chad recommended, create a child theme and copy the header.php file to it. You’d then wrap the site title in a conditional php statement that will make it H1 on front page but H2 or H3 anywhere else.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Remove H1 Tag from Site Title’ is closed to new replies.