Title: document.write violation
Last modified: February 15, 2022

---

# document.write violation

 *  Resolved [dimal](https://wordpress.org/support/users/dimalifragis/)
 * (@dimalifragis)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/document-write-violation/)
 * I started having a violation of document.write warning within Chrome. All themes
   i have tried.
 * I read your reply in an other (closed) topic but made no sense. What exactly 
   is the problem? WordPress? Your plugin? The Adsense code? Something else?
 * Please elaborate on this. Also i get no warning from the plugin about the violation
   as you say.
 * Thank you

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

 *  Plugin Author [Spacetime](https://wordpress.org/support/users/spacetime/)
 * (@spacetime)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/document-write-violation/#post-15368159)
 * Some ad codes use old JavaScript method `document.write` which can’t be used 
   asynchronously (after the page is loaded and created, for example when using 
   client-side insert method):
    [https://adinserter.pro/documentation/troubleshooting#document-write](https://adinserter.pro/documentation/troubleshooting#document-write)
 * You need to contact ad network to get asynchronous ad code.
 *  Thread Starter [dimal](https://wordpress.org/support/users/dimalifragis/)
 * (@dimalifragis)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/document-write-violation/#post-15368264)
 * Not in my case. I got a fresh code from my Google Adsense account, **async** 
   tagged.
 * Same issue. Not sure what i must do next.
 * Thank you
 *  Thread Starter [dimal](https://wordpress.org/support/users/dimalifragis/)
 * (@dimalifragis)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/document-write-violation/#post-15368271)
 * For testing purpose i disabled your plugin and posted the Adsense code into a
   TEXT widget.
 * Works great, NO VIOLATION warnings. So it must be your plugin or some setting
   in your plugin?
 * Actually scap the above. Not true. Still happens….
    -  This reply was modified 4 years, 4 months ago by [dimal](https://wordpress.org/support/users/dimalifragis/).
    -  This reply was modified 4 years, 4 months ago by [dimal](https://wordpress.org/support/users/dimalifragis/).
 *  Plugin Author [Spacetime](https://wordpress.org/support/users/spacetime/)
 * (@spacetime)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/document-write-violation/#post-15368370)
 * The plugin does not use this method.
    Disabling the plugin can only tell you 
   if the error is caused by some code/block inserted by the plugin. You need to
   figure out which code (block) causes the error: Pause all blocks and then enable
   one by one (check also header/footer code).
 * But if you still have the error when Ad Inserter is disabled then the code is
   not inserted by Ad Inserter – make sure you flush all the caches before checking.
 * To check your site/settings:
    [https://wordpress.org/support/topic/ad-inserter-support-forum-before-you-ask-for-help/](https://wordpress.org/support/topic/ad-inserter-support-forum-before-you-ask-for-help/)
 *  Thread Starter [dimal](https://wordpress.org/support/users/dimalifragis/)
 * (@dimalifragis)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/document-write-violation/#post-15368448)
 * Thanks, not an Ad Inserter issue, since it still happend with the plugin disabled.
 * I will try to figure this out.
 * Thanks for your time, GREAT plugin. The **hooks feature** has saved my life ….
   using it with plugins ….

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

The topic ‘document.write violation’ 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/)

 * 5 replies
 * 2 participants
 * Last reply from: [dimal](https://wordpress.org/support/users/dimalifragis/)
 * Last activity: [4 years, 4 months ago](https://wordpress.org/support/topic/document-write-violation/#post-15368448)
 * Status: resolved