Title: HTML code posting error in Block Editor
Last modified: July 6, 2022

---

# HTML code posting error in Block Editor

 *  [heyyoufinance](https://wordpress.org/support/users/heyyoufinance/)
 * (@heyyoufinance)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/html-code-posting-error-in-block-editor/)
 * Hello. When I try to paste HTML code into the block editor, my post is not able
   to be saved or updated and generates this error code “Updating failed. The response
   is not a valid JSON response.” I’ve been advised that this is a block editor 
   problem and I should switch to the classic editor, but I much prefer using the
   block editor and would like to resolve this compatibility issue between the HTML
   code and the block editor. Thank you.

Viewing 15 replies - 1 through 15 (of 30 total)

1 [2](https://wordpress.org/support/topic/html-code-posting-error-in-block-editor/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/html-code-posting-error-in-block-editor/page/2/?output_format=md)

 *  [Vijay Hardaha](https://wordpress.org/support/users/vijayhardaha/)
 * (@vijayhardaha)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/html-code-posting-error-in-block-editor/#post-15503261)
 * What kind of tags do you have in HTML?
 *  [mrtom414](https://wordpress.org/support/users/mrtom414/)
 * (@mrtom414)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/html-code-posting-error-in-block-editor/#post-15503375)
 * How are you adding the code? The Gutenberg blocks are react components. They 
   are transformed into HTML with comments to be stored in the database. If you 
   are switching to the code editor and just pasting it in. You will probably encounter
   some problems. There is an HTML block use it if you are not already doing so.
    -  This reply was modified 4 years, 2 months ago by [mrtom414](https://wordpress.org/support/users/mrtom414/).
 *  Thread Starter [heyyoufinance](https://wordpress.org/support/users/heyyoufinance/)
 * (@heyyoufinance)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/html-code-posting-error-in-block-editor/#post-15503405)
 * I choose the block “Custom HTML” and I paste the HTML code there. I discovered
   the issue when I tried to paste HTML code to display Google ads on my post. I’ve
   done it this way for months and months and this is the first time running into
   an issue.
 *  Moderator [threadi](https://wordpress.org/support/users/threadi/)
 * (@threadi)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/html-code-posting-error-in-block-editor/#post-15504094)
 * Do you have a concrete example of the problematic HTML code at hand?
 * Which WordPress version do you use exactly? Do you have the Gutenberg plugin 
   additionally installed and if so in which version?
 *  Thread Starter [heyyoufinance](https://wordpress.org/support/users/heyyoufinance/)
 * (@heyyoufinance)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/html-code-posting-error-in-block-editor/#post-15504098)
 * Here is an example HTML code that I’ve tried to publish: `<script async src=”
   [https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-5069043027173587&#8243](https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-5069043027173587&#8243);
   
   crossorigin=”anonymous”></script> <!– Ad Unit 1 Square –> <ins class=”adsbygoogle”
   style=”display:block” data-ad-client=”ca-pub-5069043027173587″ data-ad-slot=”
   1542860076″ data-ad-format=”auto” data-full-width-responsive=”true”></ins> <script
   > (adsbygoogle = window.adsbygoogle || []).push({}); </script>`
 * I use WordPress version 5.9.2
 * I do not have the Gutenberg plugin additionally installed.
 *  Moderator [threadi](https://wordpress.org/support/users/threadi/)
 * (@threadi)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/html-code-posting-error-in-block-editor/#post-15504119)
 * I can insert the code without any problems in a wordpress 5.9.2 installation 
   without any plugins.
 * Try it and see if it works for you without any active plugins. If so, one of 
   the plugins used is responsible. Possibly also the theme (I have TwentyTwentyTwo
   active), but imho rather unlikely.
 *  Thread Starter [heyyoufinance](https://wordpress.org/support/users/heyyoufinance/)
 * (@heyyoufinance)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/html-code-posting-error-in-block-editor/#post-15504127)
 * Even if I deactivate all of my plugins, I still get the same error message. I
   use the theme Generate Press.
 *  Moderator [threadi](https://wordpress.org/support/users/threadi/)
 * (@threadi)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/html-code-posting-error-in-block-editor/#post-15504142)
 * Even with Generate Press, I can’t reproduce the error when updating the page 
   in Gutenberg. However, I noticed something else. When saving and reopening the
   page, the HTML block cannot be displayed because it contains “invalid code”. 
   The reason is the HTML comment in the code. So:
 * `<!- Ad Unit 1 Square ->`
 * Remove this one line from your code.
 * If this does not solve the problem, you should check the hosting to see if there
   is any log entry for the memory problem. Your hoster can tell you where to find
   the log files. If necessary, debugging with WordPress would also be useful, it
   creates its own log file. See: [https://wordpress.org/support/article/debugging-in-wordpress/](https://wordpress.org/support/article/debugging-in-wordpress/)
 *  Thread Starter [heyyoufinance](https://wordpress.org/support/users/heyyoufinance/)
 * (@heyyoufinance)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/html-code-posting-error-in-block-editor/#post-15504381)
 * I removed that line from the code & still received the same error message.
 * I then reached out to my host & was advised that there was no error recorded 
   in the log. I’m at a dead end.
 *  Thread Starter [heyyoufinance](https://wordpress.org/support/users/heyyoufinance/)
 * (@heyyoufinance)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/html-code-posting-error-in-block-editor/#post-15504386)
 * Host claims that it’s an issue with the block editor.
 *  [mrtom414](https://wordpress.org/support/users/mrtom414/)
 * (@mrtom414)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/html-code-posting-error-in-block-editor/#post-15504439)
 * You are adding javascript not html. You should either use an[ adsence plugin](https://wordpress.org/plugins/simple-google-adsense/)
   from the plugin directory or [enqueue the script in the functions.php](https://developer.wordpress.org/reference/functions/wp_enqueue_script/).
 *  Thread Starter [heyyoufinance](https://wordpress.org/support/users/heyyoufinance/)
 * (@heyyoufinance)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/html-code-posting-error-in-block-editor/#post-15504502)
 * No, I am adding HTML. I have inserted ads this way for over 50 posts and it has
   not been an issue until now.
 *  Moderator [threadi](https://wordpress.org/support/users/threadi/)
 * (@threadi)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/html-code-posting-error-in-block-editor/#post-15504860)
 * Just to be sure: you use the HTML block in the Gutenberg editor for this? Does
   the page in question have any other content? Have you ever inserted this code
   alone in a page without any other content?
 * If you can’t find a solution here, you should get someone to look at it directly.
   That would be possible e.g. here: [https://jobs.wordpress.net](https://jobs.wordpress.net)
 * EDIT:
    One more thought: you could also check your browser’s developer console
   to see what exactly is logged there when you save. How to get there is described
   here: [https://wordpress.org/support/article/using-your-browser-to-diagnose-javascript-errors/](https://wordpress.org/support/article/using-your-browser-to-diagnose-javascript-errors/)
    -  This reply was modified 4 years, 2 months ago by [threadi](https://wordpress.org/support/users/threadi/).
 *  [mrtom414](https://wordpress.org/support/users/mrtom414/)
 * (@mrtom414)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/html-code-posting-error-in-block-editor/#post-15505316)
 * Open the inspector go to console look to see if there is any JavaScript errors.
   You are running a script so if there is a problem it should show up under the
   console. The script tag is used to run scripts. The html part of the code is 
   the target area for the script.
 * If there is an error it should appear under the console area of the inspector.
   Without seeing the site or error messages it not really possible to tell what
   going on.
 *  Thread Starter [heyyoufinance](https://wordpress.org/support/users/heyyoufinance/)
 * (@heyyoufinance)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/html-code-posting-error-in-block-editor/#post-15506504)
 * Here is my error message when looking at Console
 *     ```
       Uncaught
       T
       message: "adsbygoogle.push() error: All ins elements in the DOM with class=adsbygoogle already have ads in them."
       name: "TagError"
       pbr: true
       stack: "TagError: adsbygoogle.push() error: All ins elements in the DOM with class=adsbygoogle already have ads in them.\n    at np (https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-5069043027173587:235:210)\n    at cp (https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-5069043027173587:231:340)\n    at https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-5069043027173587:226:47\n    at di.n.oa (https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-5069043027173587:85:794)\n    at Vi (https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-5069043027173587:100:1098)\n    at Zo (https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-5069043027173587:226:29)\n    at Yo (https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-5069043027173587:223:69)\n    at https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-5069043027173587:243:475\n    at di.n.oa (https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-5069043027173587:85:794)\n    at Vi (https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-5069043027173587:100:1098)"
       <a href="https://codex.wordpress.org/Prototype">Prototype</a>: Error
       constructor: ƒ T(a)
       <a href="https://codex.wordpress.org/Prototype">Prototype</a>: Object
       ```
   
    -  This reply was modified 4 years, 2 months ago by [Steven Stern (sterndata)](https://wordpress.org/support/users/sterndata/).
    -  This reply was modified 4 years, 2 months ago by [Steven Stern (sterndata)](https://wordpress.org/support/users/sterndata/).

Viewing 15 replies - 1 through 15 (of 30 total)

1 [2](https://wordpress.org/support/topic/html-code-posting-error-in-block-editor/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/html-code-posting-error-in-block-editor/page/2/?output_format=md)

The topic ‘HTML code posting error in Block Editor’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 30 replies
 * 10 participants
 * Last reply from: [Steven Stern (sterndata)](https://wordpress.org/support/users/sterndata/)
 * Last activity: [3 years, 10 months ago](https://wordpress.org/support/topic/html-code-posting-error-in-block-editor/page/2/#post-15802379)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
