: No index no follow after page load 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
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)
More posts by @Sarah324
2 Comments
Sorted by latest first Latest Oldest Best
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.
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; ?>
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.