Title: Javascript snippet saving as plain text
Last modified: April 10, 2024

---

# Javascript snippet saving as plain text

 *  Resolved [foltest](https://wordpress.org/support/users/foltest/)
 * (@foltest)
 * [2 years, 1 month ago](https://wordpress.org/support/topic/javascript-snippet-saving-as-plain-text/)
 * Hi,
 * Everytime I try to create a snippet and save it as Javascript code, it’s saved
   as plain text, so it just prints plain text on the header or footer. The steps
   are simple:
    - Write javascript code on a new snippet
    - Save it
    - When the page reloads, it’s turned into plain text and saved as that.
 * I disabled every addon and it is a fresh wp install.

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

 *  Plugin Author [Mircea Sandu](https://wordpress.org/support/users/gripgrip/)
 * (@gripgrip)
 * [2 years, 1 month ago](https://wordpress.org/support/topic/javascript-snippet-saving-as-plain-text/#post-17678721)
 * Hi [@foltest](https://wordpress.org/support/users/foltest/),
 * Can you please check if the Code Type is still JavaScript after saving? Or is
   it defaulting to HTML?
 * The issue might be with the plugin not being able to assign the code type correctly
   for your snippet.
 *  Thread Starter [foltest](https://wordpress.org/support/users/foltest/)
 * (@foltest)
 * [2 years, 1 month ago](https://wordpress.org/support/topic/javascript-snippet-saving-as-plain-text/#post-17680156)
 * Hi, [@gripgrip](https://wordpress.org/support/users/gripgrip/).
 * Yes, as I said, it is saving as plain text fragment. I already uninstalled and
   reinstalled, but nothing works.
 * Thank you.
 *  Plugin Author [Mircea Sandu](https://wordpress.org/support/users/gripgrip/)
 * (@gripgrip)
 * [2 years, 1 month ago](https://wordpress.org/support/topic/javascript-snippet-saving-as-plain-text/#post-17680163)
 * Hi [@foltest](https://wordpress.org/support/users/foltest/),
 * If the code type remains HTML after saving, even though you set it to JavaScript,
   you may be encountering an issue with assigning taxonomy terms.
 * We saw this a few times before where after transferring a website or running 
   a search & replace on the whole website taxonomy terms are no longer being added
   correctly.
 * To test this theory: can you please go to the regular Posts > Categories page
   and add a new category?
 * If that also throws an error the issue is likely related to the scenario I described
   above.
 * If that works, we’ll have to look into this in more detail – can you please reach
   out using the form at [https://wpcode.com/contact](https://wpcode.com/contact)
 * Thanks
 *  Thread Starter [foltest](https://wordpress.org/support/users/foltest/)
 * (@foltest)
 * [2 years, 1 month ago](https://wordpress.org/support/topic/javascript-snippet-saving-as-plain-text/#post-17724489)
 * Hi [@gripgrip](https://wordpress.org/support/users/gripgrip/). Sorry for the 
   late response.
 * I tried that and it works perfectly.
 * Here is a video of the bug: [https://imgur.com/a/1eNPfMD](https://imgur.com/a/1eNPfMD)
 * Thank you in advance.
 *  Plugin Author [Mircea Sandu](https://wordpress.org/support/users/gripgrip/)
 * (@gripgrip)
 * [2 years, 1 month ago](https://wordpress.org/support/topic/javascript-snippet-saving-as-plain-text/#post-17725443)
 * Hi [@foltest](https://wordpress.org/support/users/foltest/),
 * Thank you for the details, that is very weird and it’s not something we encountered
   before so I’m not sure what is causing this issue without looking further into
   it.
 * Does this happen if you create a new snippet and set it to JavaScript code type?
 * Please also consider reaching out to us via the contact form at [https://wpcode.com/contact](https://wpcode.com/contact)
   so that you can share more details regarding your setup privately if you want.

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

The topic ‘Javascript snippet saving as plain text’ is closed to new replies.

 * ![](https://ps.w.org/insert-headers-and-footers/assets/icon-256x256.png?rev=2758516)
 * [WPCode - Insert Headers and Footers + Custom Code Snippets - WordPress Code Manager](https://wordpress.org/plugins/insert-headers-and-footers/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/insert-headers-and-footers/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/insert-headers-and-footers/)
 * [Active Topics](https://wordpress.org/support/plugin/insert-headers-and-footers/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/insert-headers-and-footers/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/insert-headers-and-footers/reviews/)

 * 5 replies
 * 2 participants
 * Last reply from: [Mircea Sandu](https://wordpress.org/support/users/gripgrip/)
 * Last activity: [2 years, 1 month ago](https://wordpress.org/support/topic/javascript-snippet-saving-as-plain-text/#post-17725443)
 * Status: resolved