Title: Max Insertions
Last modified: February 21, 2019

---

# Max Insertions

 *  Resolved [ghazz](https://wordpress.org/support/users/ghazz/)
 * (@ghazz)
 * [7 years, 4 months ago](https://wordpress.org/support/topic/max-insertions/)
 * The problem I’m experiencing is attempting to limit how many times an ad unit
   shows up, when inserting before an HTML element. I am choosing a max of 1 insertion,
   yet it inserts an AdSense ad unit at every occurrence of this HTML element.
 * Here is a screenshot of my code block: [https://www.dropbox.com/s/9k9iad80ku8abg8/2019-02-20_15-03-50.png?dl=0](https://www.dropbox.com/s/9k9iad80ku8abg8/2019-02-20_15-03-50.png?dl=0)
 * [Here is a page](https://www.thatswhatsup.com/rags-to-riches-15-celebs-who-were-born-poor-and-built-their-own-empires/)
   I’m testing this on. You can see that it’s showing an ad unit at every single
   occurrence of the HTML element, instead of limiting to 1 occurrence.
 * The result is 2 ad units at every single listicle item in my article, as seen
   here: [https://www.dropbox.com/s/0nuz3vrjqa6fqc2/2019-02-20_15-05-47.png?dl=0](https://www.dropbox.com/s/0nuz3vrjqa6fqc2/2019-02-20_15-05-47.png?dl=0)
 * I just want this to occurrence once, before the first item in my article, above
   the number 15 in this example.
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fmax-insertions%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 8 replies - 1 through 8 (of 8 total)

 *  Plugin Author [Spacetime](https://wordpress.org/support/users/spacetime/)
 * (@spacetime)
 * [7 years, 4 months ago](https://wordpress.org/support/topic/max-insertions/#post-11230084)
 * Max insertions limit can work only for server-side insertions.
 * Client-side insertion is done according to the CSS selector you configure.
    If
   this selector matches more than one element you will have more than one insertion.
 * Therefore, either switch to server-side insertion (you need to enable Output 
   buffering)
    [https://adinserter.pro/documentation/automatic-insertion#before-after-html-element](https://adinserter.pro/documentation/automatic-insertion#before-after-html-element)
 * or limit insertions with appropriate CSS selector.
 *  Thread Starter [ghazz](https://wordpress.org/support/users/ghazz/)
 * (@ghazz)
 * [7 years, 4 months ago](https://wordpress.org/support/topic/max-insertions/#post-11232874)
 * Hello,
 * Thank you for the response. I enabled output buffering, switched to serverside
   on that block, but now none of the ad units show up after doing this. Anything
   else I need to change?
 *  Thread Starter [ghazz](https://wordpress.org/support/users/ghazz/)
 * (@ghazz)
 * [7 years, 4 months ago](https://wordpress.org/support/topic/max-insertions/#post-11232879)
 * This is what I see with output buffering enabled: [https://www.dropbox.com/s/wr8ipcb3xyg5ix9/2019-02-21_11-21-56.png?dl=0](https://www.dropbox.com/s/wr8ipcb3xyg5ix9/2019-02-21_11-21-56.png?dl=0)
 *  Plugin Author [Spacetime](https://wordpress.org/support/users/spacetime/)
 * (@spacetime)
 * [7 years, 4 months ago](https://wordpress.org/support/topic/max-insertions/#post-11232909)
 * Can you please try to clear all caches and reload the page with Ctrl F5?
 *  Plugin Author [Spacetime](https://wordpress.org/support/users/spacetime/)
 * (@spacetime)
 * [7 years, 4 months ago](https://wordpress.org/support/topic/max-insertions/#post-11232944)
 * This is blank ad block (currently no ad served).
 * I still see client side insertion for multiple blocks 1.
 *  Thread Starter [ghazz](https://wordpress.org/support/users/ghazz/)
 * (@ghazz)
 * [7 years, 4 months ago](https://wordpress.org/support/topic/max-insertions/#post-11232975)
 * It looks like it is indeed working! Will test and make sure, thank you!
    -  This reply was modified 7 years, 4 months ago by [ghazz](https://wordpress.org/support/users/ghazz/).
 *  Thread Starter [ghazz](https://wordpress.org/support/users/ghazz/)
 * (@ghazz)
 * [7 years, 4 months ago](https://wordpress.org/support/topic/max-insertions/#post-11233005)
 * Now about half the time or more, the ad blocks are blank, before ads served 90%
   + of the time. Is that because of output buffering?
 *  Plugin Author [Spacetime](https://wordpress.org/support/users/spacetime/)
 * (@spacetime)
 * [7 years, 4 months ago](https://wordpress.org/support/topic/max-insertions/#post-11233015)
 * No.
    This only does processing and insertion after the page is generated.
 * You only need to wait for a while until Google crawls the pages and finds ad 
   code there.

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘Max Insertions’ is closed to new replies.

 * ![](https://ps.w.org/ad-inserter/assets/icon-256x256.jpg?rev=1502039)
 * [Ad Inserter - Ad Manager & AdSense Ads](https://wordpress.org/plugins/ad-inserter/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/ad-inserter/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/ad-inserter/)
 * [Active Topics](https://wordpress.org/support/plugin/ad-inserter/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/ad-inserter/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/ad-inserter/reviews/)

 * 8 replies
 * 2 participants
 * Last reply from: [Spacetime](https://wordpress.org/support/users/spacetime/)
 * Last activity: [7 years, 4 months ago](https://wordpress.org/support/topic/max-insertions/#post-11233015)
 * Status: resolved