Trusted WordPress tutorials, when you need them most.
Beginner’s Guide to WordPress
WPB Cup
25 Million+
Websites using our plugins
16+
Years of WordPress experience
3000+
WordPress tutorials
by experts

How to Remove Visual Editor Mode in WordPress (The Easy Way)

The visual editor in WordPress can be great for beginners, but it often gets in the way when you need precise control over your content formatting.

Whether you’re pasting code snippets, working with custom HTML, or just prefer the simplicity of text-only editing, removing the visual editor can speed up your workflow.

The good news? After extensive testing, I’ve found an easy way to disable the visual editor and stick with the clean, code-friendly text editor.

In this guide, I’ll show you exactly how to remove the visual editor in WordPress, based on my hands-on testing experience.

Remove Visual Editor Mode in WordPress

Why Remove the Visual Editor Mode in WordPress?

Some WordPress users prefer to remove the visual editor to avoid extra formatting and gain more control over their HTML. The visual editor can automatically insert styling or additional tags, which can cause issues if you’re trying to keep your code clean and precise.

By default, WordPress opens in the visual editor. This mode shows a styled, What-You-See-Is-What-You-Get (WYSIWYG) interface.

You can add blocks for text, images, videos, buttons, and more. It also gives you formatting tools for changing text color, adjusting typography, aligning content, and embedding media.

For more details, see our tips on mastering the WordPress visual editor.

Visual editor mode in WordPress

While this mode is helpful for most users, it can sometimes apply unexpected formatting or create extra HTML that’s hard to clean up.

The code editor offers a more minimal interface. Instead of blocks, it shows the raw HTML behind your content. There are no formatting buttons or previews—just plain text and markup.

Code Editor mode in WordPress

This makes it ideal for users who want full control over the structure and style of their content without switching back and forth between editing modes.

Now, let’s look at how to disable the visual editor and work directly in the code editor by default.

How to Remove the Visual Editor Mode in WordPress

You can turn off the visual editor in WordPress by adding custom code to your theme’s functions.php file. However, this can be risky because even a tiny error could break your site and lock you out of the dashboard.

That’s why I recommend using WPCode, which is the best WordPress code snippets plugin.

Unlike editing theme files directly, WPCode lets you safely add custom code without touching your core files. What makes it even better is its built-in error handling.

If something goes wrong, WPCode will automatically disable the faulty snippet to keep your site running smoothly.

These features are exactly why I find WPCode to be the safest and easiest way to add custom code in WordPress, especially if you’re a beginner.

You can also check out our full WPCode review to learn more about our experience with the tool.

One important thing to note before we start: This method only disables the visual editor for your user account. WordPress saves this setting individually for each user, so others on your site will still see the visual editor unless the code runs for them, too.

First, you need to install and activate the WPCode plugin. For details, see our tutorial on how to install a WordPress plugin.

💡Note: The free version of WPCode has everything you need to follow this tutorial. However, as your site grows, you may want to upgrade to WPCode Pro to unlock powerful features, such as smart conditional logic, a cloud library of snippets, and the ability to schedule snippets.

Upon activation, head over to the Code Snippets » + Add Snippet page from the WordPress dashboard.

Here, click the ‘Use Snippet’ button under the ‘Add Your Custom Code (New Snippet)’ option.

Choose 'Add Your Custom Code (New Snippet)' option

This will take you to the ‘Create Custom Snippet’ page, where you have to select ‘PHP Snippet’ as your code type from the popup.

Then, add a name for your snippet. It’s best to use a clear, descriptive name, such as ‘Disable Visual Editor’, so you can easily identify what the code does later.

Choosing PHP snippet in WPCode

Next, add the following custom code into the ‘Code Preview’ box:

// Force rich editing ON for current user
add_filter('user_can_richedit', '__return_true');

// Force rich editing OFF for current user
add_filter('user_can_richedit', '__return_false');

This snippet turns off the visual editor for your user account and switches WordPress to show only the code editor when you’re writing posts or pages.

That means you won’t see any formatting buttons or block options — just the raw HTML view of your content.

After that, switch the toggle from ‘Inactive’ to ‘Active’ so the code will run.

Then, click the ‘Save Snippet’ button to store your changes.

Activate snippet to remove the visual editor

Now, open a new post or page in the block editor. You will notice that the visual editor is disabled, and the code editor is set as the default.

Note: If you are using the classic editor, then don’t worry. You can still follow all the steps above to disable the visual mode and use the plain text editor in WordPress.

With this mode, you will see your content as raw HTML, which means it won’t have the usual formatting or styling options in the block panel that appear in the visual editor.

For example, a paragraph block will look something like this in the editor: 

<!-- wp:paragraph --><p>This is my paragraph.</p><!-- /wp:paragraph -->

You’ll also notice the ‘Add Block’ (+) button is disabled. This is because you are now in the code editor, which shows the raw HTML of your blocks instead of the visual interface.

Code Editor preview

How to Enable the Visual Editor Mode Again in WordPress

If you want to re-enable the visual editor in WordPress, all you need to do is disable the code snippet that turned it off. You can do this easily from the WPCode dashboard by toggling the status switch to “Off.”

To get started, go to the Code Snippets page in your WordPress admin area. Locate the snippet that disables the visual editor and toggle it off.

Deactivate the snippet that disables the visual editor

Once disabled, WordPress will automatically restore the visual editor for your user account — no additional steps required.

This simple toggle is a quick fix if you ever change your mind or need the visual editor back for editing posts and pages more easily.

Visual editor mode in WordPress

Bonus: Use Distraction Free Mode in WordPress

Now that you have started working using the code editor, enabling distraction-free mode can improve your focus.

Since the code editor doesn’t use the customization options in the block panel, that extra space can become unnecessary clutter.

With distraction-free mode, all unnecessary elements are hidden, giving you a clean, fullscreen workspace. This lets you focus entirely on your content, which can boost concentration, creativity, and productivity as you write.

Activate the Distraction free mode

To activate this mode, just open a page or post in the block editor and click the three-dot icon at the top right corner. This will open a dropdown menu where you must choose the ‘Distraction free’ option.

Once you have done this, you can now write your content on a clean and clutter-free canvas. To learn more, see our tutorial on how to use the distraction free fullscreen editor in WordPress.

We hope this article helped you learn how to remove visual editor mode in WordPress. You may also want to see our ultimate guide on how to use the WordPress block editor or our top picks for the best Gutenberg-friendly WordPress themes.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

Disclosure: Our content is reader-supported. This means if you click on some of our links, then we may earn a commission. See how WPBeginner is funded, why it matters, and how you can support us. Here's our editorial process.

The Ultimate WordPress Toolkit

Get FREE access to our toolkit - a collection of WordPress related products and resources that every professional should have!

Reader Interactions

21 CommentsLeave a Reply

  1. Hi, I used the option to disable the visual editor in many of my WP sites, but I have now noticed that the option is no longer available.

    It is present for old users, but when creating a new user this option dissaperd,

    is there a fix for it?

    • That is due to the 6.8 WordPress update. We will update this article for an alternate option when we can!

      Admin

  2. short and clear explanation.

    I myself have never used this feature, especially since the block editor era.

    but there may be conditions where turning off the visual editor can help efficiency in creating or editing articles.

  3. Your advice is great but surely the best/additional solution would be to stop some of the idiotic behaviour of the visual editor, ESPECIALLY adding and in stupid places, which can disrupt pages completely. I’ve even seen it add tags in the middle of internal style declarations! It also seems to remove HTML comments at times.

    As one of several people maintaining a certain website, I’ve had to waste many hours fixing the mess made by the visual editor because someone else insists on using it.

    SURELY it can be made to listen to what the user actually TYPED instead of taking matters into its own hands for no reason. If I type a succession of carriage returns, and didn’t go into text and add , MAYBE because that’s what I actually WANTED.

    This behaviour has been *programmed* into it, it can therefore be removed.

  4. Do you use wordpress visual editor on your website ? Or any plugin of shortcodes instead or any thing else ? Mind sharing ?

  5. Hello,

    I’m hoping you can help me with my Visual Editor issue. I know this page addresses how to disable the Visual Editor, but I’m hoping you can help to enable my Visual Editor. I am a freelance writer and a client set up a WordPress account for me on her site. I cannot access the Visual Editor. The disable Visual Editor box in NOT checked. And, when I tried to click on Visual, all of my text disappears. The word counter remains the same as if there are invisible words on the page. Perhaps there is something you can tell me that I can forward onto the site owner.

    Thanks so much for your help :)
    Karen

  6. Hi there! Do you happen to know if it would cause formatting issues if the visual editor is enabled for one user and they were told not to click the text editor button at all (for my client, so they can do things like change text color for a word here and there) and disabled for me (so that I can easily code things if needed)? Thank you!!

  7. for WordPress Visual Editor is acting weird, it is not showing up in Firefox and Chrome but working fine in IE… what should be the error, I have even reinstalled the WordPress using the reinstall option in the dashboard..

Leave A Reply

Thanks for choosing to leave a comment. Please keep in mind that all comments are moderated according to our comment policy, and your email address will NOT be published. Please Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.