No index for Help Center desktop version only

1 댓글

  • Thomas Esposito

    According to a Google dev, since pages are rendered when being crawled, you can inject a noindex meta tag via Javascript. That being said, I imagine the code would look something like this (note I'm using jQuery and didn't test this):
    Source


    (function($){
    /*Check for mobile header - this appears to be a class on mobile version of helpcenter only*/
    if(!($('.mobile-header').length)){
    /*If that mobile header class doesn't exist, we can assume we're on the desktop version, add no index!*/
    $("head").append('<meta name="robots" content="noindex">');
    }
    })(jQuery);

     

     

    1

댓글을 남기려면 로그인하세요.

Zendesk 제공