• Resolved Anuj

    (@anujmakhloga)


    Hi,

    I have placed an ad in the sidebar for the non-amp version, but somehow it’s showing in the amp version too. Earlier, I was using the other amp plugin, and with that, everything was fine.

    But since I activated this official amp plugin, that ad is showing in the amp version. I have disabled the amp compatibility of the advertisement from the plugin, but it’s still there.

    The code is placed via the widgets section. I have installed the amp for gp plugin with this amp and the transitional mode is on, just in case.

    Is there any way to remove that ad from amp only? Theme support asked me to contact you first.

    The page I need help with: [log in to see the link]

Viewing 13 replies - 1 through 13 (of 13 total)
  • James Osborne

    (@jamesosborne)

    Thanks for reaching out and providing details of what you’re encountering. In order for us to know more on your ads setup can you share how you’ve implemented ads on your non AMP URLs? By this I mean are you using a plugin or shortcode with the widget you mentioned and are you getting your ad code directly from AdSense?

    In addition to details on how you’re adding ad code to the widget if you’d like to share your Site Health information here or by using our private user form I’d be happy to look into your current setup.

    Thread Starter Anuj

    (@anujmakhloga)

    Thank you.

    The plugin I am using for ads placement is ads for wp

    Ads placement –
    3 (in-between content) ads in non-amp and 4 (in content ads) ads in amp version.

    Everything is fine with content ads. I haven’t put any shortcodes for them, ads showing automatically between the posts.

    Now, the problem is with sidebar ad. First you can check the setting for the same – sidebar settings upper part remaining part

    You can check amp compatibility is disabled from the plugin. But the ad is still appearing in the amp version.

    How is the sidebar ad placed on the website?

    The process –

    Wordpress dashboard > appearance > widgets > right sidebar > pic

    Is it helpful?

    James Osborne

    (@jamesosborne)

    Many thanks for sharing the additional insights, very useful indeed. It looks like the Ads plugin you’re using does have AMP compatibility and therefore it may be a case of the plugin converting your sidebar ad to an AMP compatible sidebar ads on AMP URLs.

    Have you tried reaching out to the ads plugin? As the issue you’re encountering isn’t related to the AMP plugin I would suggest seeking support from the plugin directly.

    One other option rather than using an ads plugin you could explore is to paste a single ad unit code directly from AdSense into a custom HTML widget. That way it will only appear on canonical (non AMP) URLs.

    Let me know if you have any questions with the above.

    Thread Starter Anuj

    (@anujmakhloga)

    That’s a great idea! Thank you for the solution.

    Ad is not showing, but now there is a small white rectangular box showing in the amp version. Any solution regarding this issue? Or should I contact theme support?

    James Osborne

    (@jamesosborne)

    No problem at all, happy to help.

    Ad is not showing, but now there is a small white rectangular box showing in the amp version.

    This is to be expected as the AMP plugin will only remove the non AMP compatible aspects. If you want to share an example of a URL with this behavior I can take a look and maybe provide you with a CSS snippet to hide the container.

    Thread Starter Anuj

    (@anujmakhloga)

    You can check the one I have attached with this thread.

    James Osborne

    (@jamesosborne)

    That’s the widget container box. What you could do in this case is add the below css rules for that particular widget. As you’re using AMP in transitional mode you could add this to your themes style.css file or preferably your themes customizer or a custom plugin.

    html#amp aside#block-5 {
        display: none;
    }

    As you’re using the #amp selector it will apply to AMP URLs only.

    Let me know if you have any queries with the above.

    Thread Starter Anuj

    (@anujmakhloga)

    Thank you, sir.

    I pasted this in the additional CSS section of my theme, but it’s not working. Am I doing something wrong?

    James Osborne

    (@jamesosborne)

    Apologies, you can use the below instead of the previous snippet I suggested:

    html[amp] aside#block-5 {
        display: none;
    }

    Let me know if that works for you.

    Thread Starter Anuj

    (@anujmakhloga)

    Fantastic.

    Thank you for helping me out with this.

    James Osborne

    (@jamesosborne)

    Not a problem! Get in touch if you have any further queries, and be sure to share your plugin review after comparing performance and testing out the various settings.

    Thread Starter Anuj

    (@anujmakhloga)

    For sure. Thanks again.

    Thread Starter Anuj

    (@anujmakhloga)

    Hi,

    That container is showing again. The CSS you provided last time is still there but it’s not working now.

    This is the css –

    html[amp] aside#block-5 {
    display: none;
    }

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘remove ads from sidebar in amp’ is closed to new replies.