0

I have a component which makes a promotion "expire" after a certain date, when it expires I want to add a NO FOLLOW NO INDEX meta tag via JS.

The question is would Google stop indexing this page as the NO INDEX comes after page load(with the JS)

1

Unfortunately, this is one of those things that you will need to test for yourself. Although Google has been known to index JavaScript-generated content; there doesn't seem to be any case studies out there that prove whether or not Google takes note of JS-generated meta tags.

My advice is: Run some tests or check to see if the promotion has expired using a server-side language. Example with PHP:

<?php if($promoExpired): ?>
    <meta name="robots" content="noindex, nofollow">
<?php endif; ?>
  • if i could i would have... but i guess i got to test it myself... – ronen Sep 23 '14 at 10:59
  • @ronen Create a temporary page and see if it gets indexed. – Wexford Sep 23 '14 at 11:08
1

Do not use JavaScript to change meta information

Using JavaScript to add no-index is a bad idea because JavaScript is processed after the <head> has been downloaded. You should use PHP or manually edit the HTML after the promotion.

No index works but its not like instant coffee

You should also note that Google does not instantly remove pages when you use no-index or robots.txt to block Google. Also, Google will need to visit the site to actually find that you no longer want it indexed, depending on how many crawls you get a week will determine when Google first notices the no index, another issue could be is that Google doesn't always honor the no-index on the first crawl discovery, it does this to prevent web masters accidentally removing high ranking pages from the index.

Request the page to be removed using Webmaster Tools

The best solution would be to use a no-index, robots and request the page to be removed via Webmaster Tools using the URL removal tool, or just update the page with a notice sorry this promotion has now ended and use a 410 gone return.

Your Answer

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

Not the answer you're looking for?Browse other questions tagged or ask your own question.