Appropriate Way to Stop Adsense Ads on Specific Post [Blogger]


#1

Hello,

As Per Adsense T.O.S CSS Property of Div {display: none} is not permitted to Use to Stop Ads. According the Google Adsense terms of service it’s not allowed to manipulate their code snippet. It’s also not allowed to show ads through an IFRAME or to use JavaScript and Ajax to show or hide Adsense ads. But it’s allowed to exclude the whole Adsense snippet whenever you like.

Please Help me to How can i Stop Ads Legally on Specific Posts?? Via Java Script?

How Can i Remove/Block/Empty Div elements before Loading or Execution of Ads Script??

Thanks in Advance!!!


#2

@Aitazaz_Ahsan Dear,

You can use the following xml conditions for doing the same that you want.

If you use Css property Display:none; you would probably lose your adsense account, However i think, you can use the alternate way to remove or show the adsense on specific location.

You can display or show adsense only on specific locations. using The Blogger Conditional Tags.

To display on homepage

 <b:if cond='data:blog.url == data:blog.homepageUrl'>
Adsense CODE GOES HERE
</b:if>

to display only on post pages.

<b:if cond='data:blog.pageType == "item"'>
Adsebse CODE GOES HERE
</b:if>

to display on post and static pages.

 <b:if cond='data:blog.pageType != &quot;index&quot;'>
Adsense CODE GOES HERE
</b:if>

to display on archive, next, previous, and home page

<b:if cond='data:blog.pageType == &quot;index&quot;'>
Adsense CODE GOES HERE
</b:if>

**How to use the above condition tags ?**

1: Go to blogger >> Layout >> add >> javascript gadgets and then

2: Add one of your above coding into gadget.

3: Now replace Adsense code goes here with your adsense coding.

I hope this little tutorial helpful for you. If you need more help just ping me here.


#3

You can place the conditional anywhere in your template HTML, except inside a section or inside a widget content box. The content can be a div, a section, a style tag, another conditional tag etc. Reversing a condition (hide specific widget from post pages) A condition can be reversed simply by replacing the comparison operator from == (is equal to) to != (is not equal to), like so:

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

CONTENT (TO BE EXECUTED IF CONDITION IS TRUE)

</b:if>

In the example above, the content will only appear on pages other than post pages (i.e. removed/hidden from post pages). This method is not applicable to Label-search and First Post conditionals


#4

How can we block adsense ads on specific post in Blogger?