• I love how easy this plugin makes inserting multiple ads between paragraphs on posts in WordPress, however, there’s one issue I’m having.

    The ads also show up on Google AMP pages, and because they are not in the proper AMP Ad format, they cause our pages to be invalid, which removes our AMP pages from Google’s search engine results, as well as the “news carousel” at the top of mobile search results — which, in turn, causes us to lose a lot of traffic.

    Is there a way to stop the ads from showing up on AMP pages? I would love to use this plugin, but I can’t use it right now because it’s invalidating our AMP pages.

    See here for more info. on valid AMP HTML codes: https://www.ampproject.org/docs/reference/spec

    • This topic was modified 7 years, 4 months ago by think2wice.
Viewing 6 replies - 1 through 6 (of 6 total)
  • @think2wice Are you using any plugin to generate the amp pages for your blog?

    @think2wice, please update the plugin to version 1.1.2 in which a new filter named ‘insert_post_ads_enabled’ has been introduced. You can disable ads created using this plugin from being printed on your AMP pages by using the filter ‘insert_post_ads_enabled’ and setting its value to boolean false.

    Thread Starter think2wice

    (@think2wice)

    Thank you for the fast reply! My apologies for the delayed response on my end. I assume I’m supposed to insert this in the “functions.php” file, however, I don’t know anything past that. Can you please provide the EXACT code I am to insert to make this work?

    Thread Starter think2wice

    (@think2wice)

    I did some Googling and figured out this is the proper code to insert into functions.php:

    add_filter('insert_post_ads_enabled', '__return_false');

    However, this disables the plugin on my AMP pages as well as my regular pages. I believe the problem is that our “functions.php” file is shared across regular pages and AMP pages. Is there a way to disable the plugin SPECIFICALLY on AMP pages? I assume there’s some sort of “if/else” query I should wrap around the filter or something?

    By the way, I’m using the official WordPress AMP plugin from Automattic.

    • This reply was modified 7 years, 4 months ago by think2wice.

    Sorry for the late reply. I will look into this and get back to you with an answer.

    Hi @think2wice,
    I’ve checked with the latest versions (WP, IPA, AMP) and it looks like ads are disabled on the /amp/ pages with the default settings (without using “insert_post_ads_enabled” filter).
    Could you please try to update plugins (and possibly WP) to the latest versions?
    If the problem is still persists, could you please provide us example links to your AMP pages?

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Stop ads from showing on AMP pages’ is closed to new replies.