Saltbox Posted February 29 Share Posted February 29 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! Link to comment Share on other sites More sharing options...
Rodrigo Posted February 29 Share Posted February 29 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! 1 Link to comment Share on other sites More sharing options...
Cassie Posted February 29 Share Posted February 29 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. 1 Link to comment Share on other sites More sharing options...
Saltbox Posted February 29 Author Share Posted February 29 @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? Link to comment Share on other sites More sharing options...
Rodrigo Posted February 29 Share Posted February 29 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! 1 Link to comment Share on other sites More sharing options...
Saltbox Posted March 1 Author Share Posted March 1 @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! Link to comment Share on other sites More sharing options...
Rodrigo Posted March 1 Share Posted March 1 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! Link to comment Share on other sites More sharing options...
GreenSock Posted March 19 Share Posted March 19 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). Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now