Preventing Google from indexing the contents of a div by reversing the string

后端 未结 6 847
时光说笑
时光说笑 2021-01-07 23:47

I want to prevent that Google indexes the contents of one

on my page. Of course I can create an image but that\'s not really an option in my case si
6条回答
  •  迷失自我
    2021-01-08 00:15

    I used server side codes to hide div from googlebot

    
    
    public static function isNotGoogleBot() { $ua = strtolower($_SERVER['HTTP_USER_AGENT']); if(strpos($ua,'googlebot') === false && strpos($ua,'mediapartners-google') === false)return true; return false; }

提交回复
热议问题