Jump to content

Why is the site logo image inside H1 tags?

Recommended Posts

Posted

Site URL: https://www.mouthmedianetwork.com/

When I run our site through various SEO analysis tools, it keeps getting flagged with the error that we have more than one H1 tag on our pages.

I looked at the page source, and for some reason the "logoImage" has H1 tags around it.

I don't know if we're being penalized for this in search or not, but it sure sets off a lot of alarms on the analysis platforms (largely screpy.com).

Is there a quick fix for this by inserting some code?

Screen Shot 2021-10-25 at 5.07.53 PM.png

  • Replies 9
  • Views 3.7k
  • Created
  • Last Reply

Top Posters In This Topic

Posted

This element error wouldn't be the sole cause to effect your overall SEO ranking. It would have already crawled your page and discovered the headers and titles. Each program is different in how it ranks your SEO though.

According to my results, your biggest struggle seems to be more about loading times for scripts, images, and CSS. You can get a better idea about what's jamming you up using PageSpeed insights too.

 

seoaudit.png

Posted
On 10/25/2021 at 10:12 PM, c137555 said:

We have more than one H1 tag on our pages. I don't know if we're being penalized for this in search

This doesn't negatively affect SEO.

You can improve things by reducing your image file sizes. These currently account for over 60% (1.7MB) of the content when loading your homepage.

Me: I'm Paul, a SQSP user for >18 yrs & Circle Leader since 2017. I value honesty, transparency, diversity and good design ♥.
Work: Founder of SF.DIGITAL. We provide high quality original extensions to supercharge your Squarespace website. 
Content: Views and opinions are my own. Links in my posts may refer to my own SF.DIGITAL products or may be affiliate links.
Forum advice is completely free. You can thank me by selecting a feedback emoji. Buying a coffee is generous but optional.

Posted (edited)

Yeah, image compression is on my list. Rewriting a bunch of pages first though. Thank you.

Not sure how to pair down the scripts, a lot of that extra code seems to come from Squarespace itself.

The H1 tags around the logo image are still going to bug me though. They shouldn't be there. How do I fix that?

Edited by c137555
Posted
32 minutes ago, FashionTechGuru said:

Not sure how to pair down the scripts, a lot of that extra code seems to come from Squarespace itself.

Squarespace are taking steps to improve overall performance but there is nothing you can do to reduce the size or increase the performance of the built-in scripts. 

Me: I'm Paul, a SQSP user for >18 yrs & Circle Leader since 2017. I value honesty, transparency, diversity and good design ♥.
Work: Founder of SF.DIGITAL. We provide high quality original extensions to supercharge your Squarespace website. 
Content: Views and opinions are my own. Links in my posts may refer to my own SF.DIGITAL products or may be affiliate links.
Forum advice is completely free. You can thank me by selecting a feedback emoji. Buying a coffee is generous but optional.

  • 2 years later...
Posted

Hey Y'all!

I'm a one person marketing team for my company and we work with a third party seo agency for keeping our site inline with SEO best practices. In our latest audit, we found an h1 tag wrapped around our site img logo. This has two negative consequences: First, the H1 is not visible to users which can be considered black hat SEO and a negative rank factor for your site. Secondly, Google and other search engines are reading this same H1 as the primary header for each page because it comes before all other H tag indicators. 

<h1 id="logoImage"><a href="/"><img alt="Hybrid Cloud Management Platform | Cloud Management Platform | RackWare" data-src="https://www.rackwareinc.com/.hb-image/Lyo-/UG02YWM1NStIVWhFRXJMdXVhOFNVSXVWQkhoRTdSSU0-" class=" hb-defer-offscreen" /></a></h1>

I tried plugging in some custom code in the code injector to remove the h1 wrapper, but nothing seems to be working. As I'm not a web developer, wanted to reach out to the forum and see if there were any suggestions or recommendations. I'll attach what I tried throwing into the custom code injector below: 

<script> 
document.addEventListener('DOMContentLoaded', function() {
    // Get the h1 element
    var h1Element = document.getElementById('logoImage');

    if (h1Element) {
        // Create a new anchor element
        var anchorElement = document.createElement('a');

        // Get the img element within the h1
        var imgElement = h1Element.querySelector('img');

        // Set attributes of the anchor element
        anchorElement.setAttribute('href', '/');
        anchorElement.appendChild(imgElement.cloneNode(true)); // Cloning the img element

        // Replace the h1 element with the anchor element
        h1Element.parentNode.replaceChild(anchorElement, h1Element);
    }
});
</script>

Thanks!

Posted

Please post the URL for a page on your site where we can see your issue. For us to see the URL you need to include the link in the content of your post. The URL field the forum software provides is not shown to us.

A link to the backend of the your site won’t work for us, i.e. a URL that contains /config/.

Please set up a site-wide password, if your site is not public and you've not already done so.

Post the password here.

Adding a site-wide password does not allow anyone to alter your site. It only allows those with the password to see your site.

Please read the site-wide password and how to share a link documentation to understand how they work.

You may find How to post a forum question post useful.

We can then take a look at your issue.

Find my contributions useful? Please like, upvote, mark my answer as the best ( solution ), and see my profile. Thanks for your support! I am a Squarespace ( and other technological things ) consultant open for new projects.

  • 3 months later...
Posted
<script>
  document.addEventListener('DOMContentLoaded', function() {
      const div = document.createElement('div');
      const a = document.querySelector('#logoImage a');
      const aStr = a.outerHTML;
      div.innerHTML = aStr;
      const h1 = document.getElementById('logoImage');
      h1.replaceWith(div);
  });
</script>
<style>
  div#logoWrapper img {
       max-width: 250px;
  }
</style>

This code works! I wrote this because other solutions used jQuery and this is plain JavaScript. IMPORTANT: I had to place it inside of Website > Pages > Settings (Gear Icon) > Advanced. When I placed it in Website > Website Tools > Code Injection it did not work nor could i get any code that changes the DOM to work from there. Unfortunately this means I had to add the code to every page one by one. Is Squarespace blocking DOM manipulation from the Code Injection fields? It would be more ideal to place this code there so it could be added in a single place and effect all pages. Thanks

Posted
<script>
  document.addEventListener('DOMContentLoaded', function() {
      const div = document.createElement('div');
      const a = document.querySelector('#logoImage a');
      const aStr = a.outerHTML;
      div.innerHTML = aStr;
      const h1 = document.getElementById('logoImage');
      h1.replaceWith(div);
  });
</script>
<style>
  div#logoWrapper img {
       max-width: 250px;
  }
</style>

This code works! I wrote this because other solutions used jQuery and this is plain JavaScript. IMPORTANT: I had to place it inside of Website > Pages > Settings (Gear Icon) > Advanced. When I placed it in Website > Website Tools > Code Injection it did not work nor could i get any code that changes the DOM to work from there. Unfortunately this means I had to add the code to every page one by one. Is Squarespace blocking DOM manipulation from the Code Injection fields? It would be more ideal to place this code there so it could be added in a single place and effect all pages. Thanks

Posted
2 hours ago, JonathanGrover said:

Is Squarespace blocking DOM manipulation from the Code Injection fields?

No, they aren’t. 

Me: I'm Paul, a SQSP user for >18 yrs & Circle Leader since 2017. I value honesty, transparency, diversity and good design ♥.
Work: Founder of SF.DIGITAL. We provide high quality original extensions to supercharge your Squarespace website. 
Content: Views and opinions are my own. Links in my posts may refer to my own SF.DIGITAL products or may be affiliate links.
Forum advice is completely free. You can thank me by selecting a feedback emoji. Buying a coffee is generous but optional.

Create an account or sign in to comment

You need to be a member in order to leave a comment

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.