0

I have a web-based app (not primarily content-based) that relies on some modern browser tech to function. I want to show a default message in the markup for when the browser isn't running JavaScript or cannot run my code due to lack of compatibility.

How do I prevent search engines from using this content on search results pages? Is there some way I can indicate in an element that all containing content should be ignored?

<div noindex>
  <p>Sorry, but this site requires ...</p>
</div>
  • Google executes JS if it's simple enough, so one idea would be to use noscript tags, then write a small piece of JS to remove all the noscript tags. I've never tried that, though, so I'm not sure it would work. – Maximillian Laumeister Feb 9 at 2:17
  • I also want this to display to people, even if they have JavaScript enabled. That's why <noscript> doesn't work. While <noscript> would display for folks with JavaScript completely disabled, that doesn't cover ES6, nor detection for other features. So, I have this div now which I remove with script... but I want to also indicate that the contents of this div shouldn't be indexed. – Brad Feb 9 at 2:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.