How to easily disable the Gutenberg editor using code


Table of Contents:



Last updated February 11th, 2025 17:22

WordPress is a great content management system, but it divides its users into two groups. The first group is those who absolutely love the native block editor Gutenberg, and the second group is those who hate it. There’s probably nothing in between. If you belong to the second group, you’ll be interested in how you can disable Gutenberg. This is possible with a short code that you can add to your website using the WPCode plugin.

Installing the WP Code plugin

To add code to your website, you can choose between two options. You can add the code directly into the file where it belongs, or you can use a plugin that will insert parts of the code into your site on the fly. The second option is better for one simple reason: it’s safer, and the code won’t be overwritten with every update that rewrites the file containing your code.

To install the WP Code plugin, follow these steps:

  • Click on “Plugins” in the left menu
  • Select “Add New” from the submenu
  • Notice the search field in the upper right corner
  • Type “WP Code” into the search field
  • Once WordPress finds the plugin, install and activate it.

If you’re interested in a complete article where I describe working with this plugin, check it out here: How to add custom code to WordPress.

wpcode

How to disable the Gutenberg editor using code

Now that you have the WP Code plugin installed, a new item called “Code Snippets” has appeared in the left menu. Click on it and select “+ Add Snippet” from the menu. On the next screen, click on “Add Your Custom Code (New Snippet).” First, enter a custom name for the snippet and then choose the code language. The snippet is written in PHP.

jak zakázat Gutenberg editor ve WordPressu

In the code insertion editor, paste the following PHP code:

				
					add_filter('gutenberg_can_edit_post', '__return_false', 5);
add_filter('use_block_editor_for_post', '__return_false', 5);
				
			

Conclusion

Once you save and activate this snippet, the block editor will be simply disabled at the system level. After that, it’s up to you to choose an alternative, whether it’s Elementor, SeedProd, or any other editor or builder.

The website is created with care for the included information. I strive to provide high-quality and useful content that helps or inspires others. If you are satisfied with my work and would like to support me, you can do so through simple options.

Byl pro Vás tento článek užitečný?

Klikni na počet hvězd pro hlasování.

Průměrné hodnocení. 0 / 5. Počet hlasování: 0

Zatím nehodnoceno! Buďte první

Jak užitečný vidíte tento článek.

Sledujte mě na sociálních médiích.

Je mi líto, že pro Vás nebyl článek užitečný.

Jak mohu vylepšit článek?

Řekněte mi, jak jej mohu zlepšit.

newsletter

Subscribe to the Newsletter

Stay informed! Join our newsletter subscription and be the first to receive the latest information directly to your email inbox. Follow updates, exclusive events, and inspiring content, all delivered straight to your email.

Odebírat
Upozornit na
guest
0 Komentáře/ů
Nejstarší
Nejnovější Nejvíce hlasováno
Vložené zpětné vazby.
Zobrazit všechny komentáře.

Pokud mi chcete napsat rychlou zprávu, využije, prosím, níže uvedený
kontaktní formulář. Děkuji.

Další Kontaktní údaje