Google AdSense has introduced Responsive AdSense Ads long back,
To make sure the Ad gets displayed depending on the screen resolution.
For example, when you choose responsive ad, a 728×90 leaderboard ad will be displayed in the desktop version and a smaller 468×60 banner to viewers on a tablet.
But, What if you completely want to hide the ad?
Many people asked me various questions like “How to display different AdSense ads in desktop and mobile?”.
Well, I have faced this problem myself a few months back and came up with a solution,
Which I’m going to share with everyone now.
This will probably solve most of your problems.
There are many plugins in WordPress which will fulfill your need.
I have personally used them in few of my blogs.
They are very effective, easy to use and you don’t need any technical knowledge to work with them.
Here, we are going to use conditional if tags to hide or display the ad units depending on the screen resolution.
You can even use two different ads for mobile and desktop in the same location.
Here’s the code:
Change styles, data ad client and data ad slot according to your AdSense ads code after getting your code from Google Adsense account.
The above code implementations should help you in the majority of the cases.
We already wrote an article on making custom ads responsive.
Do let me know if you are still having any more doubts in your comments below and we would be happy to help you.