### [How to Disable the WYSIWYG Editor Inside the Confirmation Settings](https://wpforms.com/developers/how-to-disable-the-wysiwyg-editor-inside-the-confirmation-settings/)

**Published:** July 14, 2021
**Author:** Editorial Team

**Excerpt:** This tutorial will show you how to disable the WYSIWYG editor inside the Confirmation Message of the form builder. 

**Content:**

## Introduction

Would you like to disable the WYSIWYG editor that appears inside the **Confirmation** settings? By default when you are inside the form builder you’ll see the standard WYSIWYG that WordPress uses. But if you wanted to disable this field you can easily do this by adding a few lines of PHP. In this tutorial, we’ll walk you through the steps on how to disable this editor.

What is a WYSIWYG editor anyway? This is what is typically referred to as a [Visual Editor](https://www.wpbeginner.com/glossary/visual-editor/ "What is: Visual Editor") or rich text Field. When you first go into the **Confirmation** settings tab from the form builder, you’ll typically see two tabs. One is for the **Visual** text editor (WYSIWYG) and the other is a plain **Text** tab.

![Confirmation settings screen offers two types of editors, the Visual and the Text](https://wpforms.com/wp-content/uploads/2021/07/wpforms-wysiwyg-editor.jpg)The plain **Text** editor is typically used more often for users who are comfortable with writing HTML.

## Adding the snippet to disable the WYSIWYG editor

Before we create the form, let’s first add the snippet that will disable this editor. To do this, just copy and paste this snippet to your site.

If you need help in adding snippets to your site, [please see this tutorial](https://wpforms.com/developers/how-to-add-custom-php-or-javascript-for-wpforms/ "How to Add Custom PHP or JavaScript for WPForms").

```

/**
Disable the WYSIWYG editor in the Confirmation settings.

@link https://wpforms.com/developers/how-to-disable-the-wysiwyg-editor-inside-the-confirmation-settings/
 */
function wpf_dev_builder_enqueues( $view ) {
 wp_add_inline_script(
 'wpforms-builder',
 '(function( $ ) {

     // Prevent crash: module reads tinymceDefaults.tinymce.toolbar1 before
     // calling wp.editor.initialize — needs a valid object, not false.
     // This runs synchronously so WPFormsBuilder is guaranteed to exist.
     if ( typeof WPFormsBuilder !== "undefined" && WPFormsBuilder.settings ) {
         WPFormsBuilder.settings.tinymceDefaults.tinymce = { toolbar1: "" };
     }

     $( document ).ready( function() {

         // Layer 1: wp.editor.initialize intercept.
         // Prevents tmce-active class + TinyMCE init flow for confirmation editors.
         if ( typeof wp !== "undefined" && wp.editor && wp.editor.initialize && ! wp.editor.initialize.wpfPatched ) {
             var wpInit = wp.editor.initialize;
             wp.editor.initialize = function( id, settings ) {
                 if ( typeof id === "string" && /^wpforms[-]panel[-]field[_-]confirmations/.test( id ) ) {
                     settings = Object.assign( {}, settings, { tinymce: false } );
                 }
                 return _wpInit.call( this, id, settings );
             };
             wp.editor.initialize.wpfPatched = true;
         }

         // Layer 2: tinymce.init intercept.
         // Belt-and-suspenders — catches TinyMCE even if wp.editor.initialize
         // is called from a path our Layer 1 missed.
         if ( typeof tinymce !== "undefined" && ! tinymce.init.wpfPatched ) {
             var mceInit = tinymce.init;
             tinymce.init = function( settings ) {
                 if ( settings && settings.selector && /wpforms[-]panel[-]field[-]confirmations/.test( settings.selector ) ) {
                     return;
                 }
                 return _mceInit.apply( this, arguments );
             };
             tinymce.init._wpfPatched = true;
         }

         // Layer 3: event fallback — re-init any editor that slipped through.
         $( "#wpforms-builder" ).on( "wpformsBuilderConfirmationsReady", function() {
             if ( typeof wp === "undefined" || ! wp.editor ) return;
             $( ".wpforms-panel-field-confirmations-message" ).each( function() {
                 var id = $( this ).attr( "id" );
                 if ( ! id ) return;
                 wp.editor.remove( id );
                 wp.editor.initialize( id, { tinymce: false, quicktags: true } );
             } );
         } );

     } );

 } )( jQuery );'
 );

}
add_action( 'wpforms_builder_enqueues', 'wpf_dev_builder_enqueues', 10, 1 );
```

This will disable the **Visual** editor (the WYSIWYG editor) completely and you’ll only see the **Text** editor.

![now you have successfully used the snippet to disable the WYSIWYG editor](https://wpforms.com/wp-content/uploads/2022/07/wpforms-confirmation-settings-wysiwyg.jpg)Would you like to also disable the automatic scrolling when there are errors on the form? Check out our article on [How to Disable the Scrolling Effect on Field Validation Errors](https://wpforms.com/developers/how-to-disable-the-scrolling-effect-on-field-validation/ "How to Disable the Scrolling Effect on Field Validation Errors").

**Categories:** Tutorials

**Tags:** PHP

---

