Skip to content

Instantly share code, notes, and snippets.

@Albert-IV
Last active December 26, 2015 08:09
Show Gist options
  • Save Albert-IV/7120595 to your computer and use it in GitHub Desktop.
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
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