in php how could i know if it is the google bot visiting my site? what i want to do is to have is so when google bot visits my site to show some text but if it isnt then dont show the text

how would i be able to do that?

    Depending on what you're going to display or hide, this sounds like cloaking, which google disapproves of. Strongly. As in they'll remove your site from their results if they think you're doing it.

    Anyway, you just have to check if the text "googlebot" is in $_SERVER['HTTP_USER_AGENT']. (If you're not sure how to test for the presence of a string check out strpos.)

      to avoid cloaking (or to make it more difficult at least) google sometimes visits your site without having googlebot in $_SERVER['HTTP_USER_AGENT']

        Cloaking is a great way to get banned from google all together. The SEO forums have indicated that google is getting better and better at detecting it, I would tread lightly.

        What are you trying to accomplish?

          im trying to have text descripbing my site cause google not only scans the meta tags for info about your site they also scan alll the words, so i want to have words that describe my site accually showing up on as if it were on the page

            Not recommended.

            1. What is cloaking?

            The term "cloaking" is used to describe a website that returns altered webpages to search engines crawling the site. In other words, the webserver is programmed to return different content to Google than it returns to regular users, usually in an attempt to distort search engine rankings. This can mislead users about what they'll find when they click on a search result. To preserve the accuracy and quality of our search results, Google may permanently ban from our index any sites or site authors that engage in cloaking to distort their search rankings.

            http://www.google.com/intl/en/webmasters/faq.html#cloaking

              bahh, guess i wont do it... thanks anyways

                Write a Reply...