Jump to content

How can I change native Squarespace header code so that my websites logo is not an H1 tag?

Recommended Posts

Hi all,

 

in advance, thank you so much for all your help.

I am new to the forum and joined because I am trying to figure out how to change the HTML coding behind my website that I built with Squarespace.

Currently, the way Squarespace sets up the website, it has set up my logo at the top of each webpage with an H1 tag. I want to change this to something else in order to improve my SEO ratings of the website.

I really do no know how to get at the HTML to do this in Squarespace.

Currently the HTML code reads that the logo is tag as a H1 class as shown in the screenshot.

 

Is there a way for me to change that? And how? Do I have to use a code in Code Injector or in CSS that tells Squarespace to replace what they have?

 

Site URL is: www.kowideoutdoors.com

 

Again thank you for all your help.

 

LogoHTMLCode.png

Edited by Mordrapheus
Adding site URL
Link to comment
  • Mordrapheus changed the title to How can I change native Squarespace header code so that my websites logo is not an H1 tag?
  • Replies 9
  • Views 1.9k
  • Created
  • Last Reply

Top Posters In This Topic

  • 4 weeks later...
On 4/30/2024 at 10:38 PM, Mordrapheus said:

site URL is www.kowideoutdoors.com

 

Thanks for your help.

You can use this code to Website > Website Tools > Code Injection > Footer

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script>
<script>
  $('h1.logo').replaceWith(function(){
    return $("<div />", {html: $(this).html()});
});
</script>
<style>
  div#logo img {
    max-width: 250px;
}
</style>

 

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment
Posted (edited)
On 5/31/2024 at 9:02 AM, tuanphan said:

You can use this code to Website > Website Tools > Code Injection > Footer

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script>
<script>
  $('h1.logo').replaceWith(function(){
    return $("<div />", {html: $(this).html()});
});
</script>
<style>
  div#logo img {
    max-width: 250px;
}
</style>

 

I have the same issue and template as the thread owner where my uploaded logo is displaying as the H1.

With that script you posted what would that do in regards to the issue of getting a H1 away from the logo? 

Edited by shyless
spelling error
Link to comment
On 6/2/2024 at 7:52 AM, shyless said:

I have the same issue and template as the thread owner where my uploaded logo is displaying as the H1.

With that script you posted what would that do in regards to the issue of getting a H1 away from the logo? 

Current logo

image.thumb.png.251ea8e622c1020fb0fc902b64139795.png

with the code

image.thumb.png.d26115c85610cf644cebf65cc8f28655.png

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment
1 hour ago, tuanphan said:

Current logo

image.thumb.png.251ea8e622c1020fb0fc902b64139795.png

with the code

image.thumb.png.d26115c85610cf644cebf65cc8f28655.png

 

So the code removes the H1 off the logo. But can you put the H1 tag somewhere else on that page for SEO purposes? There is no other option on that page to input an alternative Header.

Link to comment
  • 4 weeks later...
On 6/30/2024 at 2:45 AM, supraturbo320 said:

@tuanphan I am looking to achieve the same on my 7.0 site. For SEO, I want to remove H1 wrapper from global header logo. Looks like I will need different code, could you help? Thanks!

Site is www.jodimurphy.net

Try this code

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script>
<script>
  $('h1#logoImage').replaceWith(function(){
    return $("<h2 />", {html: $(this).html()});
});
</script>
<style>
 h2 img {
    max-width: 250px;
}
</style>

 

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment

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.