No need to worry about using JavaScript


Google says there’s no need to worry about JavaScript when it comes to search, because there’s nothing fundamentally different about it compared to static content.

This is discussed in the latest episode of the Search Off the Record podcast, which features Google’s Martin Splitt, John Mueller, Gary Illyes, and Daniel Waisberg.

Mueller brings up the topic of building a website using a static site generator, which leads to the realization that he and Splitt both use the same tool called Hugo.

For simplicity, Hugo uses Markdown language to generate pages, but that comes with the limitation of not being able to use HTML for things like nofollow tags and redirects.


Continue reading below

Mueller is creating a personal site that requires redirects, and the only way to implement them in Hugo is to use JavaScript.

He then asks Splitt, Google’s resident JavaScript expert, if there is any reason to be concerned about using JS.

There’s no reason to worry, says Splitt, and he explains why:

“No, you don’t have to worry about that …

A question I often get with JavaScript is if we treat JavaScript content differently. We have annotations for the content – what we think is the centerpiece of an article or what we think is content on the side and everything.

But as far as I know, and as far as I know, we crawl a page, then put the content in the document in our index, then we render the page, then we complete the content in the DOM.

That’s it. There is nothing fundamentally different between content generated by JavaScript and content that is static, except when there are extreme cases, and we cannot see content generated by JavaScript. “


Continue reading below

Splitt refers to “extreme cases” without going into the details of what they are. Although Google has discussed in the past how sites can experience SEO issues when using JavaScript.

The main thing to avoid is to use JavaScript in a way that forces users to interact with an element on the page in order to view the content.

A basic example would be to hide the content behind a button that users must click in order for the content to render.

This is a problem, as far as SEO goes, because Googlebot doesn’t interact with anything when it crawls web pages.

If the content is hidden behind a JavaScript element for users to click or tap, Google simply won’t see it. Therefore, the content cannot be used to understand the page and rank it in search.

Site owners who intend to use JavaScript in this way as a design choice should make sure that hidden content is not crucial to understanding what the page is about.

If you are not sure whether JavaScript is preventing Google from seeing the content of your pages, there is an easy way to find out.

Use the Explore tool like Google in Search Console to get an idea of ​​what Googlebot is capable of seeing when it crawls your site.


Continue reading below

If the Explorer tool like Google is able to render all critical content, then you are in the clear. No need to worry, as Splitt says.

This is just one of the many topics covered in the podcast. Listen to the full episode below.

Source link

Leave A Reply

Your email address will not be published.