Disabling adsense from certain posts in WP

Discussion in 'WordPress' started by dcristo, Aug 28, 2008.

  1. #1
    Is there a way to not display adsense on certain wordpress blog post pages? There is one particular page where I don't want the ads to be displayed.

    The only way I can think of is to make the post a page instead and not include the adsense code on the page template?

    Is there a different way?
     
    dcristo, Aug 28, 2008 IP
  2. Ikki

    Ikki Peon

    Messages:
    474
    Likes Received:
    34
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Hi dcristo,

    Are you using a plugin to insert the ads into your posts? If so, which one?
     
    Ikki, Aug 28, 2008 IP
  3. dcristo

    dcristo Illustrious Member

    Messages:
    19,796
    Likes Received:
    1,201
    Best Answers:
    7
    Trophy Points:
    470
    Articles:
    5
    #3
    No mate. I am placing the adsense code directly into the single post template.

    I'm looking for a way to disable adsense from showing on a certain post.
     
    dcristo, Aug 28, 2008 IP
  4. Ikki

    Ikki Peon

    Messages:
    474
    Likes Received:
    34
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Well, you'd have to add something like [noadsense] somewhere in your posts and make your script search this string in your blogpost. If found, it won't insert the adsense code into it. PHP can do this.

    I would, however, use All in One Adsense and YPN. This one does what you need: you can tell it to disable ads on a certain post by addind some string (similar to the one before)
     
    Ikki, Aug 28, 2008 IP
  5. zk5182

    zk5182 Active Member

    Messages:
    896
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    58
    #5
    <--noadsense!--> try this in the post ...let me know if it works
     
    zk5182, Aug 28, 2008 IP
  6. dcristo

    dcristo Illustrious Member

    Messages:
    19,796
    Likes Received:
    1,201
    Best Answers:
    7
    Trophy Points:
    470
    Articles:
    5
    #6
    All this seemed to do was copy this text on the page.

    I will try the wp plugin. Thanks for the suggestion.
     
    dcristo, Aug 30, 2008 IP
  7. amitpatel_3001

    amitpatel_3001 Results Follow Patience

    Messages:
    14,074
    Likes Received:
    1,178
    Best Answers:
    0
    Trophy Points:
    430
    #7
    Check out this code show ads only on Homepage , you can tweak it a bit like this :
    <?php if (is_single('beef-stew') ) { ?>
    Code which can be shown on the post with slug - beef-stew
    <?php } ?>
    Check out the wordpress conditional tags for more

    You can make the codes show ads whenever there is no post slug with your mentional slug info.
    Hope it helps!
     
    amitpatel_3001, Aug 31, 2008 IP
  8. Jalpari

    Jalpari Notable Member

    Messages:
    5,640
    Likes Received:
    137
    Best Answers:
    0
    Trophy Points:
    260
    #8
    why don't u use plugin like adman, all in one adsense and YNP they are more easily to use and customization is also take few min.

    Try to use a plugin so there will be option when u write new post or page, which will ask about disabling ads.
     
    Jalpari, Sep 2, 2008 IP