Ad Inserter
[resolved] Blocking Ad Inserter? (5 posts)

  1. Jon W
    Posted 3 years ago #


    I love this plugin, but wish to block it on my mobile theme.

    I do not mind how I block it, so long as I can do it.

    I guess there are several options, but I do not know how to implement.


    1. Add a rule to the head section in the mobile theme to stop Ad Inserter.

    2. Add a rule in Ad Inserter to only insert into specific themes (could be the best option?)

    3. Add a rule in the mobile theme to insert blocking shortcodes to all generated posts and pages.

    Or something else maybe?

    Any ideas? Doing as although Adsense looks great on mobile, DFP ads less so, and need to get DFP on my site asap.



  2. Jon W
    Posted 3 years ago #

    Almost did it.

    I deactivated the plugin in WordPress admin and then at the bottom of functions.php added:

    // Include the plugin.php file so you have access to the activate_plugin() function
    require_once(ABSPATH .'/wp-admin/includes/plugin.php');
    // Activate your plugin
    activate_plugin(ABSPATH .'/wp-content/plugins/ad-inserter/ad-inserter.php');

    which I read about here: http://wordpress.stackexchange.com/questions/4041/how-to-activate-plugins-via-code

    But it then activated it globally.....

  3. Igor
    Plugin Author

    Posted 3 years ago #

    I will try to find an elegant solution for such requirement.

  4. emcpwns
    Posted 2 years ago #

    I would really appreciate some kind of mobile specific options for this reason. I have a large banner ad that looks great on a desktop, but on mobile devices it overlaps my sidebar. Right now my website looks terrible on mobile, and I'm sure my mobile bounce rate it going to skyrocket.

  5. Igor
    Plugin Author

    Posted 2 years ago #

    OK, it is on the todo list.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Ad Inserter
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic