Simple Landing Page Cloaker Plug-in

If you have some old WP blogs that aren’t making much with Adsense and want to dabble with the dark side, try installing this landing page cloaker plug-in.

It simply displays a landing page to human visitors while bots see the blog. The cloaking is based on user agent.

To illustrate, the bots see:

While humans see:

This functionality is built into the Blackhat Plug-in and is based on IPs rather than user agents.

Edit: Thanks to Dave for reminding me. You need to add the following line of code to the first line of your theme header:

<?php if(bc_cloak()) exit(); ?>



2 Comments so far

  1. Dave on July 9th, 2007

    Interesting idea. A couple of things:

    1. the zip file provided didn’t have the hook into the event chain, so the bc_cloak() function never gets executed.

    2. the zip file provided only checks UA. Easy enough to modify.

    3. I had a similar script that I use but we always had problems cloaking the homepage because of the event chain and when headers are sent. Without modifying wordpress itself, we had to use a static fontpage to get around this as a hack. Not a big deal since all the traffic should go to the interior pages since they are long tailed. Interesting to see if you have a better understanding of which hook would work on the homepage. Our solution is old - 18 mo+ - so it may be a vestige of older versions of WP.

    4. Yuk on having to supply the html especially if you want to cloak to an aff. page, etc. Depending on the event chain, could use php-exec or simple meta-refresh but why not echo stripslashes(file_get_contents($landing_page_url)) or something like that?

  2. Brad on July 9th, 2007

    Thanks Dave, I’ve updated the post to include the simple modification to the WP theme!

    It’s a bare-bones plug-in which can easily be modified/adapted to suit personal preferences because one size doesn’t fit all, but that’s a great idea about file_get_contents($landing_page_url) which I’ll include in the BH plug-in! The exit statement in the above code prevents the header problems you mentioned.

Leave a reply

*
To prove you're a person (and not a spam bot - although we do like cute bots round here), type the security word shown in the picture.
Anti-Spam Image