Martin Splitt from Google clarified that if Google sees in the initial HTML a noindex; it won't be able to process any meta robots changes or information from within your JavaScript. Martin said "I tested if we process changes to the meta robots in JS when the initial HTML has a noindex. We don't."
Here is what he posted on Twitter:
Yeah, I think I misunderstood the question, too.
— Martin Splitt at 🏡🇨🇭 (@g33konaut) April 21, 2020
Lemme do better: I tested if we process changes to the meta robots in JS when the initial HTML has a noindex. We don't.
That's it, that's all. Everything else is not covered by me.
This does not mean Google won't read and process the other HTML, it may. He said "As you can see, we got the HTML from the crawler anyway, so we *may* process it anyway. Or not. I don't know and I'm sure the answer could be "it depends""
Here's why, illustrated. As you can see, we got the HTML from the crawler anyway, so we *may* process it anyway. Or not. I don't know and I'm sure the answer could be "it depends" pic.twitter.com/RvPJ1SCm5r
— Martin Splitt at 🏡🇨🇭 (@g33konaut) April 21, 2020
Will this be the way Google handles this forever? Probably not. But who knows.
I'd rather not. Things change, there are a bunch of code paths involved and there isn't much that's actionable for webmasters.
— Martin Splitt at 🏡🇨🇭 (@g33konaut) April 21, 2020
Plus the confusion seems to be large enough already, I'd rather re-focus the discussion on more productive avenues :)
Of course, you can test this yourself over and over again if you'd like.
Yeah. I mean the key message originally was: Don't try to use JS to remove a noindex, but I guess that's diluted to a homeopathic trace at this point :D
— Martin Splitt at 🏡🇨🇭 (@g33konaut) April 21, 2020
Forum discussion at Twitter.