Removing Ads For Your Regular Visitors
If you are using ads like Google Adsense or BidVertiser to monetize your site, good for you I say. But why not reward your regular visitors by removing them, so they can enjoy your site without ads screaming “BUY ME” left and right. Believe it or not, you can actually MAKE more money with your ads by only displaying them to search engine visitors. Why? Because of a penalty Google has called smart pricing. Basically, you get punished by earning less for having a low click through rate (CTR). How do you increase your CTR? By making sure you show your ads to those who are most likely to click on them: the search engine visitors.
Now that we’ve established having ads (or at least Google Adsense ads) do you or your regular readers no good, why not remove them to make yourself some more money and your readers happy?
Paste the the code below into the functions.php file of your current theme. Remember to change YOURDOMAIN.com into well, your domain name.
$ref = $_SERVER['HTTP_REFERER'];
$SE = array('/search?', 'images.google.', 'web.info.com', 'search.', 'del.icio.us/search', 'soso.com', '/search/', '.yahoo.');
foreach ($SE as $source) {
if (strpos($ref,$source)!==false) {
setcookie("sevisitor", 1, time()+3600, "/", ".YOURDOMAIN.com");
$sevisitor=true;
}
}
function fromasearchengine(){
global $sevisitor;
if ($sevisitor==true || $_COOKIE["sevisitor"]==1) {
return true;
}
return false;
}
When you’re done, simply insert the code below wherever you want your ad to show.
<?php if (function_exists('fromasearchengine')) {
if (fromasearchengine()) { ?>
INSERT YOUR CODE HERE
<?php } } ?>
Sorry for not posting the code directly on my site. For some reason, putting code in my entries now break post.php, even when the code is in the code syntax and has been converted to HTML friendly entities. Anyone experience the same problem? It was a problem with my wording. Apparently Wordpress is being whiny and I wrote certain words in a certain order which it did not like. Hence I had to change my wording. WTF
More information on showing ads to search engine visitors: WPRecipes, Scratch99
17 Comments
Trackbacks
Leave a Reply
Allowed tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>
This form is specifically for this blog post only, please keep your comments on topic. For general site questions and feedbacks, please use the feedback form to your right. If this is your first time here, please read my commenting policy before posting. Thanks!



good idea – wrapping ads within cookies.
Thanks for posting this!! I hope some people will implement this… I hate sites where they constantly have ads… it slows down the processing and loading times like crazy.
Destiny´s last blog post..Rebuilding the Lost
Wow, I didn’t know people were this against ads. Good thing mine are hidden away now
OMG i HATE ads, they just make me want to leave the blog site, its really flashy and annoying when your trying to read. thanks for the heads up! =)
anne´s last blog post..text me
Really? I probably see them so often on some of the blogs I read that I’ve grown used to them. I’m glad you don’t see mine anymore!
That’s very useful
i’m going to bookmark this entry for future reference ;)
Afef´s last blog post..Things i love Thursday
Glad you found it useful, thanks for bookmarking!
I heard about this, but I just thought – “yeah, and how am I supposed to do that”… But I guess it doesn’t really matter now as I don’t have ads on my site anymore.. I will remember it for future reference though.. ;)
Cecelia´s last blog post..But where do I start?
There are also plugins that do the same thing, but I prefer tweaking things myself; plugins tend to make my blog bloated
Thanks! It’s good to be back haha. This is a really good idea, there’s not much point in having those kinds of ads really otherwise cause normal visitors hardly ever click on them.
Exactly, and apparently, they annoy more people than I had imagined. Definitely not good.
I don’t mind some ad’s but when you have a personal site with lots it’s just way to much.
Once I get my work site up and running.. I might think about using this code.
I can stand a few ads here and there, as long as they aren’t in my way and don’t clash with the designs. But of course, no ads is always better than ads
What a brilliant idea. I think I’m going to try that. Thanks for the info!!!!
Angela´s last blog post..Gibberish And New Brushes Or Whatever
No problem, glad to be of help
Ohh, I never knew you could do that. Thanks for sharing. Maybe one day I’ll actually implement Adsense again.
Marsha´s last blog post..Top 10 List for 2008