How to remove AdSense ads for mobile devices while keep them for desktops?

I want to add adsense ads to be shown to visitors on desktop only.

How to remove AdSense ads for mobile devices?

You can achieve this through using “Responsive ad unit” of AdSense.

The support article Create a responsive ad unit from AdSense discusses this and gives an example. Check the “Hiding an ad unit” section.

I highlight the important parts here:

<style type="text/css">
@media (max-width: 400px) { .adslot_1 { display: none; } }
</style>
<ins class="adsbygoogle adslot_1"
   data-ad-client="ca-pub-1234"
   data-ad-slot="5678"></ins>

Note that it deleted the default style="display:block;" from the <ins></ins> tag.

Similar Posts

  • Good introductions to Hadoop 2.0 (YARN)?

    Which ones are recommended introductions to Hadoop 2.0 (YARN)? Pointers to webpages are good. Those are good ones that I find: The SoCC13 paper “Apache Hadoop YARN: Yet Another Resource Negotiator” by Vinod Kumar Vavilapalli et al.: http://www.socc2013.org/home/program/a5-vavilapalli.pdf The introduction from Hortonworks by Arun Murthy:http://hortonworks.com/blog/apache-hadoop-yarn-concepts-and-applications/ The “Official” one from Apache Hadoop website (very brief):https://hadoop.apache.org/docs/r2.2.0/hadoop-yarn/hadoop-yarn-site/YARN.html Read…

  • How to restore a Gnome 3 session?

    How to restore a Gnome 3 session? Which means: opening all the programs running last time when I log out in Gnome 3. If your purpose is to automatically start programs after logging in Gnome, another possible method is using the autostart script: https://www.systutorials.com/qa/119/how-to-write-a-autostart-script-for-gnome Run gnome-session-properties. In the “Options” tab, select “Automatically remember running applications…

  • |

    How to compare date in SQL?

    How to compare date in SQL? For example, the ‘users’ table has a column ‘loggin’ which is the date and time. How to find out the ‘users’ whose ‘loggin’ date is later than Jan 10, 2017? In SQL, dates can be compared using ‘’, ‘=‘. For the example described, the SQL statement could be: SELECT…

  • Compress PNG Images on Linux

    PNG images already use DEFLATE data compression algorithm involving a combination of LZ77 and Huffman coding. But the PNG images can be further compressed by removing non-important metadata or using lossy compression to save storage space and/or data transfer bandwidth. In this post, we introduce 2 compression ways with tools available on Linux. Lossless compression…

Leave a Reply

Your email address will not be published. Required fields are marked *