[How-To] Disable Adsene Ads from Showing Up for Logged In Users in WordPress

As a Adsense Publisher, You are strictly not allowed to click on your ads and Google definitely has a way to make out if you clicked on your Ads. The way out to prevent that from happening is by disabling the ads from showing up for any of the logged in users of the website. 

In order to ensure that Adsense Ads are not shown to logged in users of your WordPress blog, add the following lines of code into your WordPress theme. Add these lines of code within the theme files referencing Adsense ads.
if (!is_user_logged_in()) {
// Insert your adsense code here
}

Adsense Earnings

Image: Adsense Earnings

The above code makes use of the boolean function is_user_logged_in() which returns true if the user is logged in. The above code insertion into your theme files will ensure that the Adsense Ads are displayed only for user’s which are not logged into the WordPress system.

 

Therefore in short, after inserting this code,  if you are the author of your blog and logged in, you wont get to see the ads.

Via

You can follow me on Twitter at http://twitter.com/vaibhav1981

Do stay tuned to Technofriends for more, one of the best ways of doing so is by subscribing to our feeds. You can subscribe to Technofriends feed by clicking here.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: