Title: can not post javascript in gutenberg html block
Last modified: March 5, 2020

---

# can not post javascript in gutenberg html block

 *  [marselgray](https://wordpress.org/support/users/marselgray/)
 * (@marselgray)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/can-not-post-javascript-in-gutenberg-html-block/)
 * Greetings,
 * I am receiving a “Updating failed. Error message: The response is not a valid
   JSON response.” error when I attempt to put any script / javascript into an Gutenberg
   HTML block.
 * I’ve turned off plugins, updated wordpress version, checked other permissions
   and can’t seem to isolate the cause. Even doing something as simple as:
 *     ```
       <script>
       console.log('hi):
       </script>
       ```
   
 * throws the error:
 * Full page here:
 * [https://ibb.co/LnvPz4X](http://Image Here)
    -  This topic was modified 6 years, 2 months ago by [Jan Dembowski](https://wordpress.org/support/users/jdembowski/).
      Reason: Moved to Fixing WordPress, this is not an Everything else WordPress
      topic

Viewing 1 replies (of 1 total)

 *  [Joy](https://wordpress.org/support/users/joyously/)
 * (@joyously)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/can-not-post-javascript-in-gutenberg-html-block/#post-12509901)
 * Do you have the `unfiltered_html` capability? You can’t put scripts in the editor
   if you don’t.
    To get more information, use your browser’s Developer Tools to
   view the REST response content. That would be on the Net tab of the Tools. Anything(
   like an error message) that is not in JSON format will cause the error you are
   seeing.

Viewing 1 replies (of 1 total)

The topic ‘can not post javascript in gutenberg html block’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 2 participants
 * Last reply from: [Joy](https://wordpress.org/support/users/joyously/)
 * Last activity: [6 years, 2 months ago](https://wordpress.org/support/topic/can-not-post-javascript-in-gutenberg-html-block/#post-12509901)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
