Jump to content
GreenSock

oligsap

Splittext and SEO concerns

Warning: Please note

This thread was started before GSAP 3 was released. Some information, especially the syntax, may be out of date for GSAP 3. Please see the GSAP 3 migration guide and release notes for more information about how to update the code to GSAP 3's syntax. 

Recommended Posts

Hi,

 

I'm rather concerned about splitting a title (Hn) into separate letters. Can Google bots read the HTML generated ?

 

Thanks for your feedback

Link to comment
Share on other sites

Legitimate concern ... I’m not too sure how Google handles divs and spans within heading tags.

 

But, you could choose to execute/not execute certain scripts based on the reported user agent. User a server side script to put a class on <html> And then use the presence (or not) of that class as a hook in your script.

  • Like 3
Link to comment
Share on other sites

Hello @oligsap and Welcome to the GreenSock forum!

 

When the Google bot scans your page for the first time, it reads the source code of the HTML document. So it will read the <h1> text before the JavaScript has generated the new HTML <h1> markup.

 

You can also test your web page using Google web tools like Google PageSpeed Insights and Google Webmaster Tools.

 

Hope that helps   :)

  • Like 5
Link to comment
Share on other sites

Thanks @Jonathan for your input. You're right I completely forgot that, thanks !

  • Like 2
Link to comment
Share on other sites

  • 3 years later...

It's a valid concern, as you want to make sure that Google bots are able to read and understand your content. While I'm not sure about the specific details of how Google handles divs and spans within heading tags, I do know that it's important to have a well-structured and easy-to-read website in order to rank well in search results. One thing you could try is using server-side scripts to put a class on the HTML element and then using that class as a hook in your script. This way, you can control which scripts are executed based on the reported user agent. If you're looking for more information on this topic, I'd recommend checking out the link I provided. It's an SEO guide to HTTP Status Codes and it provides some helpful insights into how to optimize your website for search engines.

Link to comment
Share on other sites

Create an account or sign in to comment

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

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×