How to Hide AdSense Ads on your Website

1719

AdSense is one of the most popular tools for website owners and advertisers, introduced by Google which can easily increase the traffic on your website overnight. AdSense alone can help millions of people to earn thousands of dollars every day.

Google released Responsive ads earlier in 2016 and also announced that it would be no longer supporting flash ads from January 2017. The responsive ads are a great alternative to website owners as they can automatically adjust themselves as per the device. In other terms, ads can easily adapt to a 4 inch or a 6 inch phone or a laptop.You don’t have to learn coding for these adaptations as the code behind these Ads can easily detect the browser and display it in a correct size. Responsive Ads also give more control to brands, as they can display more content. While advertisers can tinker with the image and name to have more control.

How to hide ads 

Google doesn’t allow modifications in ads other than responsive ads. Moreover, Google has also listed other things you must avoid.

  1. Hiding ads units by using display: none
  2. Modifying ads such that content and ads overlap
  3. Manipulating the ads by using hidden keywords, IFRAME, etc or manipulating the ads to attract user's attention.
  4. Distributions of ads via email and software.
  5. Manipulating the ads to trigger an ad click by the user

Modifications that you can try

  1. Modify the responsive ads.
  2. Implement A/B testing.

But in scenarios where you want to hide the ad completely, for example, you might want to display roll-over ads only in desktop, not on mobile phone, you can use CSS coding to hide the ads.

Source : Google

Another example,

<ins class=”adsbygoogle”

style=”....

<script>

(adsbygoogle = “window.adsbygoogle || [ ] ).push ( {} ) ;

</script>

This is a small snippet of a standard AdSense code

To modify the code to display no ad, we just need to add a class and media query to hide Ads in a mobile phone if the screen width is less than 400 pixels.

Modified code will look like :

<style>

@media (max-width : 400px) }

.no_ads {

display:none;

   }

}

< ins class=”adsbygoogle no_ads”

...


Warning: A non-numeric value encountered in /home/u351846396/domains/jsmwebsolutions.com/public_html/blog/wp-content/themes/Newspaper/includes/wp_booster/td_block.php on line 308