Jump to content
Search Community

SplitText & Google SERP results conflict.

Saltbox
Moderator Tag

Recommended Posts

Posted

Hi, everyone!

 

We've been using SplitText for almost all of the heading animations on our website for a long time and accidentally revealed the following issue.

 

It seems like Google is crawling our H1s instead of Title Tags on multiple pages and as a result— it is not able to read spans SplitText breaks headings into like a sentence.

Some of the pages where H1s and other headings are crawled instead of Meta Title and Description display them as separate letters separated by spaces in SERP.

 

Is there any fix possible for that? I don't think I can find similar topics on the forum.

 

Website link

I am also attaching multiple screenshots with the issue described.

 

Thanks in advance!

image (30).png

image (32).png

image (31).png

Screenshot 2024-02-28 at 3.04.20 PM.png

Posted

That's really odd, google should be looking into your site on the server, before the JS is executed and SplitText did it's job, unless you're storing a pre-rendered version of your site in the server in that case google is doing what's supposed to.

 

Other than run SplitText's code in the client and upload a version without it to the server I can't think of something else, unless google is actually creating a fully rendered site that is also executing the JS scripts when is crawling through it.

 

I'm far from being an SEO expert so beyond this I can't really tell you , maybe this post by @Cassie can help:

 

Happy Tweening!

  • Like 1
Posted

Wild! This is new. I'll see if any of my SEO friends know what's going on here or can advise a way for me to do some tests.

  • Like 1
Posted

@Rodrigo @Cassie thank you very much for such a fast response!

 

Maybe it's a handful fact to mention: the website is done in Webflow.

 

So SplitText script is pasted into <head>, and animation is executed before </body> tag.

Could that be affecting it? Should I load SplitText script with defer maybe?

Posted

Yeah, it would make far more sense to have the script before the closing body tag rather than in the head tag, give that a try and let us know how it goes.

 

Happy Tweening!

  • Like 1
Posted

@Rodrigo Sadly Webflow has character limits for scripts in their code and the SplitText script is overflowing in the section they have for before </body> scripts (that's why I dreeeeam about CDN links, haha). I will try to leave it in <head>, but add defer, so it loads the script after the DOM is formed and recrawl the links in GA. I will come back to you on that one.

 

Thanks once again!

Posted

Hi,

 

What I meant is that you could leave SplitText in the head tag but move your custom JS code before the closing <body> tag, like that that particular code (that will run the SplitText logic) will run after the content is loaded.

 

Happy Tweening!

  • 3 weeks later...
Posted

I'm curious if you tried putting your code into a DOMContentLoaded event handler. In other words, wait for the DOMContentLoaded event to fire before you execute the SplitText/GSAP code. 

document.addEventListener("DOMContentLoaded", () => {
  // your code here...
});

Worst case is maybe listen for the "load" event (which waits for images/assets to finish too). 

  • 6 months later...
Posted

Hey guys, 

 

any news on this? i'm having the exact same issue (see attachment)

 

 

 

 

Screenshot 2024-09-30 at 9.26.59 AM.png

Posted

@Jo Mourad have you tried the DOMContentLoaded event suggestion? 

 

We are chatting with the Webflow team about better integration, so hopefully that'll be fruitful. 💚 

Posted

Hey @Cassie and @GreenSock! Thanks for the feedback! I'm with wordpress actually, and i haven't tested the DOMContentLoaded because i'd have to change quite a bit of coding and wait for crawling, etc. So i aws asking if someone tested it before i get into it!

 

Thanks ! Keep me posted?

Posted

I'm putting some dummy sites up now - from a quick glace it looks like you don't have a description meta tag - so maybe that's a quick fix? (I'll test this though)

Posted

image.png
Our description on google is coming from the meta tag, so no issues with the text. 

Screenshot 2024-10-01 at 14.32.40.png

  • Like 1

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.
×
×
  • Create New...