How To Remove Header Ad in Mobile

Posted in: Newsmag
Post count: 23

Hi there. I use Google Adsense. How can I remove the header ads in mobile/tablet view? I want to see the header only and no ad.

I am not using AMP or the TagDiv mobile plugin and can’t because they both prevent the content in my pages from showing.

Current view:

https://ibb.co/PXYCfst

https://ibb.co/4njsHJnc

I’d really like the ads above the header to be gone. I am fine with the desktop header ad.

Please help!

Post count: 35449

Hi,
The solution that I can offer is to use a custom css that will hide it from the header zone on mobile, the css is:
.td-header-sp-rec {
display: none!important;
}

This should be placed in the theme panel> custom code > advance css > phone – https://prnt.sc/x13Vx2tifJvC

Post count: 23

I tried that, unfortunately, the ad on mobile still appears above the header after I added the code you provided.

https://ibb.co/7JZwPTyw

Is there something else that I can try?

Post count: 23

Actually, never mind. I spoke too soon. It works! Will this same code also work to prevent the header code on tablets?

Post count: 23

Ok. I take that back. It does NOT work. (sorry for the back and forth)

Post count: 35449

Hi,
I just checked the website on mobile and now the header ad is no longer displayed – https://prnt.sc/M1nhiIw9UKIN
Yes, if you want to use the code for tablets too, then just copy and paste the same code in the iPad portrait section.

Post count: 23

Thank you. You are correct. It has been working the last few days since we’ve added the code. Much appreciated!

Viewing 7 posts - 1 through 7 (of 7 total)
The forum ‘Newsmag’ is closed to new topics and replies.