Last active
December 26, 2015 08:09
-
-
Save Albert-IV/7120595 to your computer and use it in GitHub Desktop.
Chrome Snippet to validate if a page is set to noindex,nofollow
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var $robots = $('meta[name="robots"]'); | |
$robots.each( function() { | |
var attribute = this.getAttribute('content'); | |
if ( attribute == "noindex,nofollow" || attribute == "nofollow,noindex" ) { | |
console.log( 'Page is%c noindex nofollowed', 'color: red; font-size: 2em;' ); | |
} | |
}); | |
if (!$robots.length) { | |
console.log( 'Page is%c indexed!', 'color: green; font-size: 2em;' ); | |
} | |
''; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment