Title: code striping in visual editor
Last modified: August 30, 2016

---

# code striping in visual editor

 *  Resolved [zmenchhofer](https://wordpress.org/support/users/zmenchhofer/)
 * (@zmenchhofer)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/code-striping-in-visual-editor/)
 * Hello,
 * im using the visual editor, putting in HTML code, save and publish the code and
   it changes it.
 * original code:
 *     ```
       <script language="JavaScript">
       <!--
       function JumpToIt(frm) {
           var newPage = frm.url.options[frm.url.selectedIndex].value
           if (newPage != "None") {
               location.href=newPage
           }
       }
       //-->
       </script>
       ```
   
 * Code that is stripped
 *     ```
       <p><script language="JavaScript">
       <!--
       function JumpToIt(frm) {
           var newPage = frm.url.options[frm.url.selectedIndex].value
           if (newPage != "None") {
               location.href=newPage
           }
       }
       //-->
       </script>
       ```
   
 * How can i keep the code of being stripped?
 * I have tried adding this to the functions.php and still doesnt work.
 * > function override_mce_options($initArray) {
   >  $opts = ‘*[*]’; $initArray[‘valid_elements’]
   > = $opts; $initArray[‘extended_valid_elements’] = $opts; return $initArray; }
   > add_filter(‘tiny_mce_before_init’, ‘override_mce_options’);
 * [https://wordpress.org/plugins/siteorigin-panels/](https://wordpress.org/plugins/siteorigin-panels/)

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

 *  Plugin Support [Andrew Misplon](https://wordpress.org/support/users/misplon/)
 * (@misplon)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/code-striping-in-visual-editor/#post-6787141)
 * Hi [@zmenchhofer](https://wordpress.org/support/users/zmenchhofer/)
 * This is unfortunately, an expected resulted based on the filters used in the 
   widget. We’d recommend using a Text widget instead.
 *  Thread Starter [zmenchhofer](https://wordpress.org/support/users/zmenchhofer/)
 * (@zmenchhofer)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/code-striping-in-visual-editor/#post-6787327)
 * I have updated the it to a text widget and it still changes the code :/
 * any other suggestions?
 *  Plugin Support [Andrew Misplon](https://wordpress.org/support/users/misplon/)
 * (@misplon)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/code-striping-in-visual-editor/#post-6787330)
 * Are you trying to display the code for reading or have it rendered by the browser?
 *  Plugin Author [Greg – SiteOrigin](https://wordpress.org/support/users/gpriday/)
 * (@gpriday)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/code-striping-in-visual-editor/#post-6787381)
 * Hi zmenchhofer
 * It’s possible that another plugin is filtering the content of the widgets. In
   general though, we suggest not using these widgets to enter javascript. Ideally
   you should be using something like this plugin
 * [https://wordpress.org/plugins/oh-add-script-header-footer/](https://wordpress.org/plugins/oh-add-script-header-footer/)

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

The topic ‘code striping in visual editor’ is closed to new replies.

 * ![](https://ps.w.org/siteorigin-panels/assets/icon.svg?rev=2556869)
 * [Page Builder by SiteOrigin](https://wordpress.org/plugins/siteorigin-panels/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/siteorigin-panels/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/siteorigin-panels/)
 * [Active Topics](https://wordpress.org/support/plugin/siteorigin-panels/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/siteorigin-panels/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/siteorigin-panels/reviews/)

 * 4 replies
 * 3 participants
 * Last reply from: [Greg – SiteOrigin](https://wordpress.org/support/users/gpriday/)
 * Last activity: [10 years, 5 months ago](https://wordpress.org/support/topic/code-striping-in-visual-editor/#post-6787381)
 * Status: resolved