On the WordPress codex, bb5999 asked how he can remove ads for logged in users. Here’s a very easy way to hide ads to registered users.
On the WordPress codex, bb5999 asked how he can remove ads for logged in users. Here’s a very easy way to hide ads to registered users.
Hiding ads for registered users is a good idea since it can help you to decrease the risk of being smart-priced by Adsense.
To achieve this, we just have to use the is_user_logged_in() function, which returns true is an user is logged in.
This recipe is very easy to use, just paste the following code anywhere on your theme.
if (!is_user_logged_in()) {
// Insert Adsense (or whatever) code here
}
5 Responses
I use this hack to hide ads from being shown to me while I am editing the blog.
Trackbacks: