Hide Ads from Admin at Blog

by Hiroshi on December 21, 2009

in General

You can trace which user is logged in. Users at WordPress have levels for access. Admin access level is 10. You can simply trace if the admin is logged in and hide ads from your blog so that admin may not see ads. If you are admin of a blog and post a lot then its a chance that you submit impressions for ads by yourself while checking your posts after publishing. More impressions but less click = less earnings. Hide your ads from you. You definitely don’t want to click your own ads, for sure. That’s why it is useful to hide your own ads from you to reduce load time + avoid impressions you do not want + more earnings.

global $current_user;
if ($current_user->user_level == 10 )echo 'Welcome, Admin';
else echo 'Welcome!';


<?php global $current_user; 
if ($current_user->user_level == 10 ) { ?>
  Admin Stuff here (leave blank)
<?php } else { ?>
  Stuff Seen By Visitors
<?php } ?>

Related Posts

Previous post:

Next post: