Skip to main content

Disable AdSense Gadgets, On Static Pages

One problem with AdSense, that some blog owners have reported, is that AdSense ads are not permitted on pages with very little AdSense relevant content.

Unfortunately for some blog owners, the responsibility for preventing this is left to the blog owner.

Blogs with static pages, and AdSense gadgets in the sidebar, are a problem here. Static pages with little blog relevant content - such as label indexes, expanded owner profiles, special gadgets like Followers displays - cause problems with the AdSense ad classifier - and can cause blogs to lose ads.

As an AdSense publisher, the blog owner is expected to ensure that ads are not displayed on unsuitable blog pages.

Fortunately, it's not difficult to block AdSense ads from static pages. Just add a CSS rule with a "static page" conditional, to block display of each AdSense gadget.

<b:if cond='data:blog.pageType == "static_page"'>

If you want to block gadget "AdSense1" from displaying on all static pages, that's a simple CSS rule, added using "Add CSS".

Note that I wrote this to selectively block AdSense gadgets from displaying - but you can use it with any gadget, that you need to block. AdSense is simply one gadget that needs to be selectively displayed.

<b:if cond='data:blog.pageType == "static_page"'>
#AdSense1 {display: none !important;}

As always, be aware that the blank line above and below the code, as displayed here, is not intended to be decorative. Any time you add CSS rules, the blank line is required, to separate each CSS rule - and make each rule operational.

If the blog publishes actual blog content on some static pages, conditionals will be a bit more complicated. This is one more reason why static pages are not typically used for blog content.

Owners of #Blogger blogs with AdSense ads, that use static pages without AdSense relevant content, need to block ads from displaying on such pages. Failure to display ads selectively can cause problems with ads on the blog.

Fortunately, a simple CSS rule can be used, to block ads from static pages.


Darnell said…
Your timing is perfect, Chuck! I got the BSOD on Friday and had to have it fixed. One of the fixes was to add the AdBlock Plus to my PC. At the same time, I noticed that my followers gadget is gone from my blog ( I was hoping it was just coincidence because that did happen once before a long time ago, but the gadget came back in a couple of days. I'll have my husband read this to see how to isolate my blog from the restriction so I can get my followers back! At least I think that's what you're saying! You know I am a complete noncomputerlanguage speaker!! Thank you! Darnell
Nitecruzr said…
Hi Darnell,

Thanks for your question!

You can use the code, to block display of any gadget - as long as you know the gadget name. I gave you "AdSense1" because AdSense gadgets are the most commonly in need of blocking, on static pages - but you can block any gadget necessary.
Unknown said…
Hi Chuck,

I added Adsense in HTML/javascript gadget.

So, as you said I need to know the gadget ID and added to the code above.

Is this correct?

and thanks.
Nitecruzr said…
Hi Lionel,

Thanks for the question!

Right, if you have an "HTML" gadget, you'll have "HTMLn". So find out the exact ID, and paste the ID into the CSS rule.

Popular posts from this blog

What's The URL Of My Blog?

We see the plea for help, periodicallyI need the URL of my blog, so I can give it to my friends. Help!Who's buried in Grant's Tomb, after all?No Chuck, be polite.OK, OK. The title of this blog is "The Real Blogger Status", and the title of this post is "What's The URL Of My Blog?".

Leave Comments Here

Like any blogger, I appreciate polite comments, when they are relevant to the blog, and posted to the relevant article in the right blog. If you want to ask me a question thats relevant to blogging, but you can't find the right post to start with (I haven't written about everything blogger related, yet, nor the way things are going I don't expect to either), ask your questions here, or leave an entry in my guestbook.

As noted above, please note my commenting policy. If you post a comment to this post, I will probably treat it as a "Contact Me" post. If you have an issue that's relevant to any technical issue in the blog, please leave a comment on the specific post, not here. This post is for general comments, and for non posted contact to me.

If the form below does not work for you, check your third party cookies setting!

For actual technical issues, note that peer support in Blogger Help Forum: Something Is Broken, or Nitecruzr Dot Net - Blogging is, almos…

What Is "" vs. ""?

With Google Domains registered custom domains becoming more normal, we are seeing one odd attention to detail, expressed as confusion in Blogger Help Forum: Learn More About Blogger.My website uses "" - am I supposed to use "", instead?It's good to be attentive to detail, particularly with custom domain publishing. This is one detail that may not require immediate attention, however.