Remove Adsense From Certain Pages and Post in Thesis

When adding Google Adsense to your WordPress website it is very handy to be able to choose which pages and posts AdSense appears on, therefore you might need to remove Adsense from the ones you want. This tutorial is targeting the Thesis WordPress theme as this is one of the most versatile premium themes I have. I actually bought Thesis for this exact reason.

Firstly, I need to explain why I would want to remove AdSense from a particular post or page.

I am a huge Adsesne fan and it is a great way to make money online. But it is not a good idea to have all your eggs in one basket, we have all heard this before. A few years ago, I really only used AdSense ads to make money online and I knew this was a bad idea. Therefore in the past few years I have been diversifying my moneymaking methods. Earlier I wrote an article about how I make money online and even though I missed out on half my moneymaking ways, you can get the picture that it is now a total mix of methods.

When it comes to Google AdSense ads, this is still the backbone of my business, but other moneymaking ways are approaching fast. There are so many ways to make money online so you need to make choices. I have found existing webpages, added affiliate banners and links to test to see if I could make more money out of existing pages. Of course this does not work every page and post and therefore I keep AdSense showing on some of them. This is why I need to choose which pages and posts AdSense appears on in Thesis. Some pages and posts have double the income by removing AdSense and placing the appropriate product to sell. Like I said this does not work for every page or post, so AdSense has now become the backup moneymaker, if the other tests do not work out.

Remove Adsense From Certain Pages and Post in Thesis

Here is the original code that I placed into my custom functions.php file. This is exactly what I had to add a AdSense ads to every post on my Thesis blog. I used CSS to position the ad.

function single_post_ad_300() {
if (is_single()) { ?>
My Adsense Code Here
add_action('thesis_hook_before_post', 'single_post_ad_300');

But I needed to remove Google Adsense ads from certain pages so I changed one line:

if (is_single()) { ?>


if (!is_page() && !is_single( array( 13406,5526,1025,14717,795,991,649, ) )) {  ?>

The numbers I have placed in there are post numbers. All you have to do is find the post number and add it in.

Watch this video showing how to find the post ID (number)

Add Adsense to a particular page

In this example I am adding ads to only certain pages. This way is hard work and I would much rather not list all the single posts to add Adsense to. However i have used this code for adding things like Facebook comments to certain pages and posts only.

if (is_single('470') || is_single('415') || is_single('418') || is_single('441')) { ?>

Another way is to use array:

if  (is_single( array( 484,526,2699, ) )) { ?>

Remove Adsense From Certain Pages and Post in Thesis

Now some people may say this is a waste of time but I have an example for you to show that it is not. The funny thing is, I asked a WordPress Theme guru how to do this with his theme and he basically told me it was a waste of time and didn’t give me an answer. Now I do not recommend his themes because I thought he was totally close minded.

Anyway I will stop blabbing and show you the proof. This screenshot below is from a product I am selling. I had to remove the Adsense Ads from 4 posts to get this income.

Unfortunately I cannot tell you the pages I am talking about as they are highly competitive pages but this is how you keep moving forward. Adsense was clearly giving me the clue telling me the pages were valuable. I just took that information and used it to my advantage.

Therefore I turned approx $400 a month from Adsense into $1000 a month and climbing! Now that is why I do this and that is why it is sometimes a smart move. Yes I had earnings from these 4 posts but now I have optimized my earnings without increasing traffic or adding new content.



  1. julia says

    Most of the people probably heard a lot about Google AdSense. No doubt it is one of the hottest ways to make money online. But it is not an easy task to make money with adsense. It required a lot of traffic away on site. With the plenty of traffic we also need website promotion techniques like SEO and especially content that will attract the ads with the highest (PPC) rate. This complete process takes a lot of time. Thanks for sharing your great idea. I personally like “Sponsorship advertising” to make money online.
    julia recently posted..Fortuna Callus Shaver

  2. says

    Great advice, I didn’t realize the impact that could come from removing AdSense from certain pages so that visitors are not distracted from other more targeted ads on that site. It just goes to show how too many adds can be a bad thing.
    Simon recently posted..Ancient Greek Coins

  3. Frank Bowes says

    Hi mitz, your last Adsense article was a great help in increasing my Adsense revenue so I’ll definitely give this a go. Thanks again for sharing your insights, they make all the difference to new bloggers like me.
    Frank Bowes recently posted..Write Content and Get Paid with Elance

  4. says

    about ads and blog design, I’m made a restyle of my blog, if you want to check it.

    ads should be placed in a way that does not annoy the reader, or they could be very informative and add value to the website, as example including interesting books that can be of help to your specific audience (mine is mainly musicians, composers, artists, freelance).
    Manuel Marino recently posted..Learn How to Sing

  5. manojtwa says

    Exciting publish. Individually I’m not a fan for AdSense and do not have them on my websites at all. There are two factors for that. First of all, in my market analysis, I check out several websites every day. Some with AdSense are okay (ie: ads are not too intrusive) but on others those textual content ads damage what could have been a reader-friendly website.

  6. Jon says

    Interesting post. Personally I’m not a fan for AdSense and don’t have them on my sites at all. There are two reasons for that. Firstly, in my niche research, I visit numerous sites every day. Some with AdSense are okay (ie: ads aren’t too intrusive) but on others those text ads ruin what could have been a reader-friendly page.

    My second reason relates to Google. If I try to sign up for AdSense they tell me I already have an account but when I try to login they tell me I haven’t. I had some fruitless discussions about that in their forum that took me nowhere fast so I just flagged the idea completely.
    Jon recently posted..Discreet Shopping Online

    • mitz says

      Instead of trying to signing up to Adsense, why not try loggin in then. Oh no, maybe someone has signed up using your name?

      I know people do overload their sites with ads but this does not mean you have to do this! There are many great opportunities out there, but if you are successful with what you are doing then you probably don’t need to stress yourself about Adsense.

      • Jon says

        Thanks for taking the time to respond Mitz. I wouldn’t mind having Adsense (sp) in moderation on some sites but since I can’t have them I’ve just taken it as a sign from the Affiliate Gods that I don’t need them:) While on that topic there seem to be two schools of thought on banners. Some swear by them but others suggest text links in posts get better results. Have you done any tests to see which work best?
        Jon recently posted..Broken Promises and New Year’s Resolutions

        • mitz says

          Definitely text links work better on some sites with fantastic content, however I have made loads of money off AdSense and still do and all of their advertising is usually a banner or text ads. What you need to do is test both and then see what works for your website. This is why I have written this post showing how to remove AdSense from certain pages only. As you can see if you read the article, there is a very good reason for this. On the other hand would not want to remove AdSense altogether as it is making me money on the pages that I have not got time to optimize and monetize.

  7. Amanda Gordon says

    Ha … and I thought I was the only one to run into a scenario of a post based adsense control! This is precisely what I did for some of my posts.

    In some of my blogs I use pages a lot. The privacy policy page should not contain adsense so I had to get dirty with code to remove adsense on specific posts and pages.
    Amanda Gordon recently posted..Hand Held Vacuum Cleaners

  8. Sheena says

    Hi, Mitz! I hope you had a great Christmas :) You are right; Google Adsense has been very helpful to bloggers but we should always look for other means to earn money online. Thanks for suggesting that we should diversify the ads in the pages of our website and never rely on Adsense alone. We can always seek for other money-making partnerships and networks. The online world is so huge and thousands of earning opportunities await. I just love the online world! It has helped me earn more for my family.

  9. Rick Castro says

    Wow.. The increase is surprisingly high. Thanks Mitz for the video and for the codes. This is a very good idea in order to increase profit.Thanks again, I really appreciated it.

    • mitz says

      Oh no..How could I misspell that great word! Thanks Albert. I would never have noticed because my spell checker doesn’t even like the word Adsense even when I do spell it correctly. :) That was just a test to see if anyone was reading the article or not! You passed!

      • john says

        hi mitz,

        may i know how many blogs you maintain ? and if you do hire writers in your other blogs / websites ?

        do you advise niche topics that are evolving such as technology and science ? rather than let say construction materials ?

        • says

          I have so many websites running in the background… I have too much work at the moment so they have been neglected a bit.. I do have writers, probably 3 permanent and a few others. i never publish anyone’s content straight up though.. It must go through me to edit if needed.

          I like to stick to topics that can be related in some way. Like this building a website site is kind of related to technology too as you cannot build a website without it. I find it better to not stretch yourself out with the topics as it is hard to create for them all.

          • john says

            yeah i understand that its really better to focus on things we really know as we can write faster and more accurate. if we know the topic then we will be able to create longer and useful content and it wont bored us, we will also be able to expand it..

            i saw your tips4pc website and learned that it has about 14,000 pages, hmm from what year did you start to post on that site?

          • john says

            your – is almost the same with , i am proud and amazed that you two are into website building.

            i was a website designer way back 2005-07 for local business, and learning SEO at the same time, but it was 2009-10 that i was able to learn link building.

            i believe perseverance and product-based website is good for adsense website, which both i lack, hehe

            im always wondering which will have better adsense revenue
            1. a product based adsense website
            2. a service based adsense website – like cleaning services
            3. how to based adsense website

  10. Mark Tesa says

    It is wise to know what works and what does not work in terms of making money online. I agree that on some pages you have to look for other means of making money apart from Adsense and knowing this can really help you to maximize on your profits.

  11. Matt Kinsella says

    I think this is more important than a lot of bloggers realize, pages plastered with ads can be distracting and take readers attention from the real content. Being careful with ad placement of each page and giving it different consideration on each page is often really appreciated by visitors.
    Matt Kinsella recently posted..How To Be Lucky In Life

  12. Liane Markus says

    I know this needs enough time and effort and thesis is actually one of the hardest part when it come to adsense. Thanks a lot for providing this because this is another knowledge for us and this will serve as a guide and reminder to each and everyone who is having problem with removing adsense.
    Liane Markus recently posted..SMS

  13. Brenda Macalino says

    This is great Nice to see this in here, that one is not really easy to do it but I have no to say you have a good idea..
    Brenda Macalino recently posted..SMS

  14. Allen says

    Another reason why you sometimes don’t want Adsense to show, is that sometimes content you post might not be allowed by Google, even though you would think your content is quite innocent. I don’t want to take any chances to getting my account banned, so I make sure Adsense is only shown on the appropriate pages.
    Allen recently posted..Great Gmail Backup Software

  15. julie says

    wow! well done you, turning $400 a month from Adsense into $1000 a month and climbing is awesome, im really impressed

    • Eugene says

      Good idea. Actually, it might be really practical to have ads only for certain categories.
      Mitz, thanx for sharing the code. I think I’ll need to modify it a bit for my blog but the essence is yours. Thanx again!

      • mitz says

        I haven’t had the need to control Ads on the categories as I only concentrate on conversions for individual pages. Once I have done this I move onto another page. Stopping Ads on Categories would not have helped me in this situation as there are 100+ posts in the same category and I only wanted to remove Adsense on 4 pages.

        As for tracking I do use URL channels in Adsense and ad channels.
        mitz recently posted..Successful WordPress Website Checklist runs on the Genesis Framework

Genesis Theme Framework for WordPress

When I changed to the Genesis Framework and the eleven40 Theme my page load score went from 58 to 79 instantly. This was without any optimization at all. The other thing about this framework and theme is that it was so simple to setup that I can highly recommend it to each and every person that visits this blog! Genesis is the smart choice for your WordPress website or blog.