Google Use The Most Restrictive Crawling Command On The Page
Here is what John Mueller said:
Google will use the most restrictive setting you have on the page (this matches how robots meta tags are generally processed, eg if you have a “noindex” + “index”, then the “noindex” will override the “index”). If you have a “nofollow” in static HTML and remove it with JS, Google will still use the “nofollow”. Similarly, if you don’t have any robots meta tag, and add a “noindex” with JS, Google will use the “noindex”. In short, adding a “nofollow” via JS would work, removing it won’t.
Google goes with the most restrictive signal they get here.
As long as it points to the original, then people who care can go there to figure things out and ask clarifying questions.
— 🍌 John 🍌 (@JohnMu) December 20, 2018