I recently password protected my site and made it a requirement for users to sign on or register in order to view the content and post on the forums. In doing this, Google dropped most of my pages from the Google search results, since GoogleBot could no longer index them due to the password protection. This means that even though my site contains really relevant information, Google can't access it anymore.
I've researched Google's First Click Policy, which seems like a feasible option for my site. It basically states:
...we will crawl and index your site to the extent that you allow Googlebot to access it. In order to provide the best possible user experience and help more users discover your content, we encourage you to try First Click Free. If you prefer to limit access to your site to subscribers only, we will respect your decision and show a “subscription” label next to your links.
In this article, Google also states some guidelines for implementing this policy:
To implement First Click Free, you must allow all users who find your page through Google search to see the full text of the document that the user found in Google's search results and that Google's crawler found on the web without requiring them to register or subscribe to see that content. The user's first click to your content is free and does not require logging in. You may, however, block the user with a login or payment or registration request when he tries to click away from that page to another section of your content site.
I don't want to open my site up for public viewing, but how can I let Google index my site again while still maintaining a level of content protection, and required membership? Through PHP, which steps should be taken to ensure that GoogleBot can read and index the content of my site, whilst restricting users to viewing just the article that Google refers them to.
googlebot
", etc. As such, this isn't about PHP at all, but how to perform an SEO task. That's a better fit for Webmasters. In fact, written as a generic SEO question with PHP examples on Webmasters, this would be an excellent fit over there (they have no canonical for this AFAIK)