Javascript: What SEOs need to know

Google Search Central · Intermediate ·📰 AI News & Updates ·6y ago

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 What do I do after being hacked?
What do I do after being hacked?
Google Search Central
2 Can rel="canonical" index my hostname and not my IP address?
Can rel="canonical" index my hostname and not my IP address?
Google Search Central
3 How can I optimize for "deep web" crawling?
How can I optimize for "deep web" crawling?
Google Search Central
4 What's a preferred site structure?
What's a preferred site structure?
Google Search Central
5 Should I tweak my titles and descriptions to improve my CTR?
Should I tweak my titles and descriptions to improve my CTR?
Google Search Central
6 When did Google start displaying "Did you mean" results?
When did Google start displaying "Did you mean" results?
Google Search Central
7 Can I tell Google not to use the posting date in my snippet?
Can I tell Google not to use the posting date in my snippet?
Google Search Central
8 Does the ordering of heading tags matter?
Does the ordering of heading tags matter?
Google Search Central
9 Which SEO agency do you recommend?
Which SEO agency do you recommend?
Google Search Central
10 Will SEO still exist in five years?
Will SEO still exist in five years?
Google Search Central
11 Star Wars or Star Trek?
Star Wars or Star Trek?
Google Search Central
12 Tips on requesting reconsideration
Tips on requesting reconsideration
Google Search Central
13 Do site load times have an impact on Google rankings?
Do site load times have an impact on Google rankings?
Google Search Central
14 Is Google doing anything different for Twitter results?
Is Google doing anything different for Twitter results?
Google Search Central
15 Will domain registration changes ding me in Google?
Will domain registration changes ding me in Google?
Google Search Central
16 How are load times displayed in Webmaster Tools calculated?
How are load times displayed in Webmaster Tools calculated?
Google Search Central
17 Why aren't penalized sites notified in Webmaster Tools?
Why aren't penalized sites notified in Webmaster Tools?
Google Search Central
18 Google India SearchMasters 2009 - Event Roundup
Google India SearchMasters 2009 - Event Roundup
Google Search Central
19 Can you talk about the change in Google's referrer string?
Can you talk about the change in Google's referrer string?
Google Search Central
20 Google Webmaster Help Forum - Koti Ivaturi - Google India SearchMasters '09
Google Webmaster Help Forum - Koti Ivaturi - Google India SearchMasters '09
Google Search Central
21 Welcome Note - Vivaik Bharadwaaj - Google India SearchMasters '09
Welcome Note - Vivaik Bharadwaaj - Google India SearchMasters '09
Google Search Central
22 Google Custom Search - Rajat Mukherjee - Google India SearchMasters '09
Google Custom Search - Rajat Mukherjee - Google India SearchMasters '09
Google Search Central
23 Building Mobile Friendly Websites - Ankit Gupta - Google India SearchMasters '09
Building Mobile Friendly Websites - Ankit Gupta - Google India SearchMasters '09
Google Search Central
24 Q & A with Adam Lasnik - Google India SearchMasters '09
Q & A with Adam Lasnik - Google India SearchMasters '09
Google Search Central
25 Webmaster Central and Best Practices - Adam Lasnik - Google India SearchMasters '09
Webmaster Central and Best Practices - Adam Lasnik - Google India SearchMasters '09
Google Search Central
26 Google Analytics and Website Optimizer - Deepak Kumar - Google India SearchMasters '09
Google Analytics and Website Optimizer - Deepak Kumar - Google India SearchMasters '09
Google Search Central
27 What are the factors that go into determining the PageRank of a Twitter page?
What are the factors that go into determining the PageRank of a Twitter page?
Google Search Central
28 Webmaster Tools spring time design refresh
Webmaster Tools spring time design refresh
Google Search Central
29 Can I publish 100+ pages at once?
Can I publish 100+ pages at once?
Google Search Central
30 Why is the @ character ignored in search queries?
Why is the @ character ignored in search queries?
Google Search Central
31 How can new pages get indexed quickly?
How can new pages get indexed quickly?
Google Search Central
32 Using a barcode scanner with Google Book Search
Using a barcode scanner with Google Book Search
Google Search Central
33 Behind the scenes of Google Webmaster Central videos
Behind the scenes of Google Webmaster Central videos
Google Search Central
34 Are shortened URLs treated differently than other redirects?
Are shortened URLs treated differently than other redirects?
Google Search Central
35 How can I make sure Google reaches my deeper pages?
How can I make sure Google reaches my deeper pages?
Google Search Central
36 What impact does server location have on rankings?
What impact does server location have on rankings?
Google Search Central
37 Will a "coming soon" page negatively impact my site?
Will a "coming soon" page negatively impact my site?
Google Search Central
38 How many pages can Google index from a single site?
How many pages can Google index from a single site?
Google Search Central
39 What if a search for my business triggers "Did you mean?"
What if a search for my business triggers "Did you mean?"
Google Search Central
40 Are CSS-based layouts better than tables for SEO?
Are CSS-based layouts better than tables for SEO?
Google Search Central
41 What impact does "page bloat" have on Google rankings?
What impact does "page bloat" have on Google rankings?
Google Search Central
42 What types of directories are seen as sources of paid links?
What types of directories are seen as sources of paid links?
Google Search Central
43 Should I include my logo text using 'alt' or CSS?
Should I include my logo text using 'alt' or CSS?
Google Search Central
44 What are some best practices for moving to a new CMS?
What are some best practices for moving to a new CMS?
Google Search Central
45 How gzip works
How gzip works
Google Search Central
46 Optimizing the order of scripts and styles
Optimizing the order of scripts and styles
Google Search Central
47 PHP performance tips
PHP performance tips
Google Search Central
48 Minimizing browser reflow
Minimizing browser reflow
Google Search Central
49 Improving website performance with Page Speed
Improving website performance with Page Speed
Google Search Central
50 Optional HTML tags
Optional HTML tags
Google Search Central
51 Optimizing web graphics
Optimizing web graphics
Google Search Central
52 Prefetching resources
Prefetching resources
Google Search Central
53 HTTP caching
HTTP caching
Google Search Central
54 Is over-optimization bad for a website?
Is over-optimization bad for a website?
Google Search Central
55 Interview with Adam Lasnik - Part 1
Interview with Adam Lasnik - Part 1
Google Search Central
56 Interview with Adam Lasnik - Part 2
Interview with Adam Lasnik - Part 2
Google Search Central
57 Interview with Adam Lasnik - Part 3
Interview with Adam Lasnik - Part 3
Google Search Central
58 Can the geographic location of a web server affect SEO?
Can the geographic location of a web server affect SEO?
Google Search Central
59 Will I be penalized if my URLs all have the same priority?
Will I be penalized if my URLs all have the same priority?
Google Search Central
60 How can I optimize my site on a small budget?
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
The AI moat paradox suggests that as AI models improve, their importance may decrease, and understanding this concept is crucial for AI professionals and businesses.
Medium · AI
170,927 AI Papers Reveal the Biggest Research Shifts of the First Half of 2026
Discover the biggest AI research shifts of 2026 based on 170,927 papers, and learn how to apply these trends to your work
Medium · Machine Learning
170,927 AI Papers Reveal the Biggest Research Shifts of the First Half of 2026
Discover the major research shifts in AI from 170,927 papers published in the first half of 2026, and learn how to analyze trends in AI research
Medium · Data Science
[PoV] When Everyone Is Smart, No One Is
In a world where AI makes everyone smart, the value of intelligence decreases, and new challenges arise
Medium · AI
Up next
‘ENOUGH IS ENOUGH’: Lebanon is STANDING UP to Iran, expert says
Fox Business
Watch →