Google says don’t use JavaScript to generate a noindex tag in the original page code

Google updated its JavaScript SEO basics documentation to clarify that may skip rendering and JavaScript execution.

Google has updated its JavaScript SEO basics documentation to clarify how Google’s crawler handles noindex tags in pages that use JavaScript. In short, if “you do want the page indexed, don’t use a noindex tag in the original page code,” Google wrote.

What is new. Google updated this section to read:

  • “When Google encounters the noindex tag, it may skip rendering and JavaScript execution, which means using JavaScript to change or remove the robots meta tag from noindex may not work as expected. If you do want the page indexed, don’t use a noindex tag in the original page code.”

In the past, it read:

  • “If Google encounters the noindex tag, it skips rendering and JavaScript execution. Because Google skips your JavaScript in this case, there is no chance to remove the tag from the page. Using JavaScript to change or remove the robots meta tag might not work as expected. Google skips rendering and JavaScript execution if the robots meta tag initially contains noindex. If there is a possibility that you do want the page indexed, don’t use a noindex tag in the original page code.”

Why the change. Google explained, “While Google may be able to render a page that uses JavaScript, the behavior of this is not well defined and might change. If there’s a possibility that you do want the page indexed, don’t use a noindex tag in the original page code.”

Why we care. It may be safer not to use JavaScript for important protocols and blocking of Googlebot or other crawlers. If you want to ensure a search engine does not rank a specific page, make sure not to use JavaScript to execute those directives.


Search Engine Land is owned by Semrush. We remain committed to providing high-quality coverage of marketing topics. Unless otherwise noted, this page’s content was written by either an employee or a paid contractor of Semrush Inc.


About the Author

Barry Schwartz

Barry Schwartz is a technologist and a Contributing Editor to Search Engine Land and a member of the programming team for SMX events. He owns RustyBrick, a NY based web consulting firm. He also runs Search Engine Roundtable, a popular search blog on very advanced SEM topics.

In 2019, Barry was awarded the Outstanding Community Services Award from Search Engine Land, in 2018 he was awarded the US Search Awards the "US Search Personality Of The Year," you can learn more over here and in 2023 he was listed as a top 50 most influential PPCer by Marketing O'Clock.

Barry can be followed on X here and you can learn more about Barry Schwartz over here or on his personal site.