Javascript: What SEOs need to know
Key Takeaways
JavaScript and SEO: What SEOs need to know
Full Transcript
[Music] all right welcome everyone to another special episode of ask Google webmasters today we picked up our t-shirts yeah cool dinosaurs because we like dinosaurs into dinosaurs and scary topics scary topics like JavaScript stop scary comes not scary alright so in the ass goggle webmaster series webmasters SEO s anyone really can submit questions to us using the hashtag a scuba masters yeah and today's topic is all about JavaScript so let's get started alright root asks us on Twitter when using the rails asset pipeline for caching what status code do we give the old asset Googlebot crawls these stale assets which we currently have 404 do we 410 them instead or do we keep them alive for a couple of months what do you think I don't really know what a rails asset pipeline is marketing Ronnie tell us more to be fair it doesn't really necessarily matter to this specific question because it's pretty much the same for every assets that you've got and that you might update at some point the way our asset pipeline however is a way for rails to process and pre-process your your assets as you have them in development for the production website so it's basically like an automatic pipeline of dealing with your assets in your rails application but what it boils down to is you have old assets you eventually have a new version of your website and then you have new assets like some old JavaScript some previous version of your CSS and images that you'll no longer having on your page stuff like that right so how do you deal with that well you just keep it around for a while until we recrawl your actual HTML content and then we get the new assets afterwards but because of caching we try to make it so that we can crawl and index your page as quickly as possible but that might mean that we're going to keep using outdated URLs and if you fall for them then we're just gonna end up with broken renders in between and that's something you probably want to avoid all right so better to keep them around for a while and you can use your server logs to figure out when we stop asking for these assets and then just fully remove them cool our next question comes from Michael Michael is asking if in pre-rendering can you skip or replace irrelevant content like JavaScript generated SVG bar graphs or anything else that this Java generated really from my point of view you should include everything as much as possible so that whenever Googlebot accesses your pages it sees the full content does does that kind of match yeah I'm not really sure like with pre-rendering do they mean yeah so they can either I mean so pre-rendering really is just running your JavaScript on the server side once whenever the content changes and then deploying the static assets to everyone in this case no you do not skip things but if you mean dynamic rendering where you would basically just give different content to the users versus crawlers then even then I wouldn't skip it cool ok so include everything our next question comes from Graham Graham asks on Twitter if your site has a chat function that rewrites the title tag for notifications to the visitor how do you or the app supplier prevent Google from indexing the javascript rewritten version of the title tag you don't I would say no so as we are rendering the page we are picking up written titles so in that case whoops well you could do is you could hide or delay the chat behind the user to action because Googlebot doesn't interact with things so if you have to click on the chat button first and then the chat pops up and then changes the title I think that would be one way of dealing with this properly Michael is asking or asking again in pre-rendering can I still use JavaScript inside the rendered output it's like JavaScript that generates minor content or layout changes or like anything that isn't really heavy I ajax.request yeah definitely so with pre-rendering you're basically regenerating those pages ahead of time and serving all of that to you and it's perfectly fine to have some JavaScript elements in there as well I think from a user point of view that makes sense anyway because sometimes you can serve content very quickly if it's pre-rendered and you can use JavaScript to add interactive elements and that's perfectly fine to make sense so you don't have to strip out all of the JavaScript if you pre render your pages absolutely it's also if you do pre rendering and then use something that is called hydration that's basically what you are aiming at you have all the content pre rendered and then you use JavaScript to enhance it into a single page web app so for instance that is perfectly okay it's just about giving the content to the user as quickly as possible so it sounds like JavaScript and SEO are gonna be with us for a while again I do think so yes yeah wow that sounds pretty cool so one of the things I keep hearing from people is like is pre rendering or dynamic rendering is that ever gonna go away do I still have to bother with all of that yes this question comes up a lot so fundamentally it will not necessarily go away entirely maybe except for dynamic rendering dynamic rendering is a workaround so we hopefully do not have to keep that around for much longer but server-side rendering and pre-rendering are actually very fundamentally useful concepts because they give the users and crawlers the content quicker right it's HTML we can pass that as it comes in javascript needs to be parsed and executed to generate the content so we cannot basically stream the content on the browser side and we don't have to we have server-side rendering available Wow yeah it sounds like there's still a lot to do maybe we should do separate YouTube videos for that what do you think mine it's a great idea and one we already have if you are checking out this channels playlist you'll see that we have a series called JavaScript SEO already it has a bunch of episodes that are covering many different topics already but we are working on more episodes so I guess subscribe to this channel to stay tuned for more yeah that sounds awesome and feel free to continue submitting your questions using the hashtag Google webmasters all right thanks for watching and see you next time bye [Music]
Original Description
In this episode of Ask Google Webmasters, John is joined again by Martin Splitt, Developer Advocate at Google, to discuss Javascript & SEO. Stay tuned as they answer questions, such as:
When using Rails Asset Pipeline for caching what status code do we give the old asset? Googlebot crawls these stale assets which we currently have 404'd. Do we 410 instead or keep the old assets alive for a couple months? It's killing our crawl budget? (submitted by @ruth_hearn77) (0:43)
In prerendering can we replace or skip irrelevant elements? I.e. svg bar graphs generated by JS? (submitted by @m_karg) (2:19)
If your site has a chat function that rewrites the title tag for notifications to the visitor, how do you or the app supplier prevent Google from indexing the JS rewritten version of the title tag? (submitted by @GOMaonaigh) (3:18)
In prerendering: can still be JS inside? JS that generates minor content layout changes, but not AJAX requests. (submitted by @m_karg) (4:00)
Will pre-rendering or dynamic rendering ever go away? (short discussion) (5:10)
Check out the JavaScript SEO playlist to deep dive into the SEO for JavaScript best practices → https://goo.gle/2RmKEG5
Relevant Google documentation:
Fix Search-related JavaScript problems → https://goo.gle/2VIh8Qs
Implement dynamic rendering → https://goo.gle/2vm2mDe
More on JavaScript rendering on the web → https://goo.gle/3cPVejg
Send us your questions on Twitter with the hashtag AskGooglebot and your question might be answered!
Google Search Central on Twitter → https://goo.gle/3f4Z0a8
Watch more AskGooglebot episodes → https://goo.gle/2OjWcvS
Subscribe to the Google Search Central Channel → https://goo.gle/SearchCentral
#AskGooglebot
Watch on YouTube ↗
(saves to browser)
Sign in to unlock AI tutor explanation · ⚡30
Playlist
Uploads from Google Search Central · Google Search Central · 0 of 60
← Previous
Next →
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
What do I do after being hacked?
Google Search Central
Can rel="canonical" index my hostname and not my IP address?
Google Search Central
How can I optimize for "deep web" crawling?
Google Search Central
What's a preferred site structure?
Google Search Central
Should I tweak my titles and descriptions to improve my CTR?
Google Search Central
When did Google start displaying "Did you mean" results?
Google Search Central
Can I tell Google not to use the posting date in my snippet?
Google Search Central
Does the ordering of heading tags matter?
Google Search Central
Which SEO agency do you recommend?
Google Search Central
Will SEO still exist in five years?
Google Search Central
Star Wars or Star Trek?
Google Search Central
Tips on requesting reconsideration
Google Search Central
Do site load times have an impact on Google rankings?
Google Search Central
Is Google doing anything different for Twitter results?
Google Search Central
Will domain registration changes ding me in Google?
Google Search Central
How are load times displayed in Webmaster Tools calculated?
Google Search Central
Why aren't penalized sites notified in Webmaster Tools?
Google Search Central
Google India SearchMasters 2009 - Event Roundup
Google Search Central
Can you talk about the change in Google's referrer string?
Google Search Central
Google Webmaster Help Forum - Koti Ivaturi - Google India SearchMasters '09
Google Search Central
Welcome Note - Vivaik Bharadwaaj - Google India SearchMasters '09
Google Search Central
Google Custom Search - Rajat Mukherjee - Google India SearchMasters '09
Google Search Central
Building Mobile Friendly Websites - Ankit Gupta - Google India SearchMasters '09
Google Search Central
Q & A with Adam Lasnik - Google India SearchMasters '09
Google Search Central
Webmaster Central and Best Practices - Adam Lasnik - Google India SearchMasters '09
Google Search Central
Google Analytics and Website Optimizer - Deepak Kumar - Google India SearchMasters '09
Google Search Central
What are the factors that go into determining the PageRank of a Twitter page?
Google Search Central
Webmaster Tools spring time design refresh
Google Search Central
Can I publish 100+ pages at once?
Google Search Central
Why is the @ character ignored in search queries?
Google Search Central
How can new pages get indexed quickly?
Google Search Central
Using a barcode scanner with Google Book Search
Google Search Central
Behind the scenes of Google Webmaster Central videos
Google Search Central
Are shortened URLs treated differently than other redirects?
Google Search Central
How can I make sure Google reaches my deeper pages?
Google Search Central
What impact does server location have on rankings?
Google Search Central
Will a "coming soon" page negatively impact my site?
Google Search Central
How many pages can Google index from a single site?
Google Search Central
What if a search for my business triggers "Did you mean?"
Google Search Central
Are CSS-based layouts better than tables for SEO?
Google Search Central
What impact does "page bloat" have on Google rankings?
Google Search Central
What types of directories are seen as sources of paid links?
Google Search Central
Should I include my logo text using 'alt' or CSS?
Google Search Central
What are some best practices for moving to a new CMS?
Google Search Central
How gzip works
Google Search Central
Optimizing the order of scripts and styles
Google Search Central
PHP performance tips
Google Search Central
Minimizing browser reflow
Google Search Central
Improving website performance with Page Speed
Google Search Central
Optional HTML tags
Google Search Central
Optimizing web graphics
Google Search Central
Prefetching resources
Google Search Central
HTTP caching
Google Search Central
Is over-optimization bad for a website?
Google Search Central
Interview with Adam Lasnik - Part 1
Google Search Central
Interview with Adam Lasnik - Part 2
Google Search Central
Interview with Adam Lasnik - Part 3
Google Search Central
Can the geographic location of a web server affect SEO?
Google Search Central
Will I be penalized if my URLs all have the same priority?
Google Search Central
How can I optimize my site on a small budget?
Google Search Central
Related AI Lessons
⚡
⚡
⚡
⚡
The AI Moat Paradox: The Better Models Become, the Less Models Matter
Medium · AI
170,927 AI Papers Reveal the Biggest Research Shifts of the First Half of 2026
Medium · Machine Learning
170,927 AI Papers Reveal the Biggest Research Shifts of the First Half of 2026
Medium · Data Science
[PoV] When Everyone Is Smart, No One Is
Medium · AI
🎓
Tutor Explanation
DeepCamp AI