1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

how to exclude some page from displaying adsense ads?

Discussion in 'Blogging' started by bimmerime, Sep 27, 2015.

  1. bimmerime

    bimmerime Regular Member

    Joined:
    May 14, 2015
    Messages:
    283
    Likes Received:
    19
    it's all in the title, i wan to exclude the privacy policy, terms,..... from displaying adsense ads
    i found this at the wordpress forum but didn't know where to put it
    Code:
    <?php if( !is_page( array('Privacy Policy', 'Contact', 'About', 'etc') ) ) : ?>ADSENSE CODE HERE
    <?php endif; ?>
    any ideas?
     
  2. blogzandstuff

    blogzandstuff Elite Member

    Joined:
    Jan 1, 2015
    Messages:
    5,815
    Likes Received:
    2,708
    Occupation:
    blog creator
    Location:
    UK
    Does your theme not allow it? it may go in your functions.php file in your child theme. first go and make a copy of your functions.php file and then add it to the bottom before the closing tag and add it to your child theme. Only do it in your child though
     
  3. back2basics

    back2basics Power Member

    Joined:
    Nov 11, 2012
    Messages:
    623
    Likes Received:
    400
    an easier way would be install a plugin like quick adsense that lets you check/uncheck where you want your ads to show. You could also use their no ad tags on specific posts if you needed to.
     
  4. Zwielicht

    Zwielicht Moderator Staff Member Moderator Jr. VIP

    Joined:
    Aug 31, 2013
    Messages:
    7,142
    Likes Received:
    12,602
    Gender:
    Male
    Occupation:
    Reaper
    Location:
    Riverside, California
    Home Page:
    I don't know much about php coding, but I found one thread on another site that mentioned putting the script in your header.php file.