Discover in this tutorial how to unregister native WordPress blocks using code.
Since a few versions of WordPress, you have the option to hide the blocks that you don’t want to be displayed in the editor
You can do this by clicking on the three dots at the top left and selecting: Tools > Block Manager.

But this does not prevent the blocks from being loaded and accessible from the manager for other users.
Therefore, you may want to cut to the chase and simply unregister these blocks so that they are not loaded in the editor.
Is this the case for you? Here is how to do it.
Steps to unregister native blocks of the WordPress editor
1. Create a file unregister-blocks.js
Insert this snippet into a new file named unregister-blocks.js inside the /lib/js/ folder:
To see this and another 997 code snippets of this website, login or subscribe here.
If the /js/ folder does not exist, create it. Or if you prefer to place it in another path in the theme, you can do it, just make sure to change it in the next step as well.
This script uses the unregisterBlockType
function to unregister the blocks you are interested in.
With the example above, you are unregistering the verse block and tag cloud, but at the end of the tutorial you will find a list of all the native blocks so you can customize it to your liking.
2. Enqueue the file unregister-blocks.js
Now, paste the following block at the end of the functions.php file of your WordPress theme:
To see this and another 997 code snippets of this website, login or subscribe here.
With these lines you get the theme to load the unregister_blocks.js
file.
WordPress native blocks
Here you have the list with all the WordPress native blocks:
- core/archives
- core/audio
- core/button
- core/buttons
- core/calendar
- core/categories
- core/classic
- core/code
- core/column
- core/columns
- core/cover
- core/file
- core/latest-comments
- core/latest-posts
- core/legacy-widget
- core/gallery
- core/group
- core/heading
- core/html
- core/image
- core/list
- core/media-text
- core/more
- core/navigation
- core/navigation-link
- core/nextpage
- core/paragraph
- core/preformatted
- core/pullquote
- core/quote
- core/rss
- core/search
- core/separator
- core/shortcode
- core/social-link
- core/social-links
- core/spacer
- core/subhead
- core/table
- core/tag-cloud
- core/text-columns
- core/verse
- core/video
- core/widget-area
With this information you can add all the blocks you want to remove to the snippet in step 1.
Conclusions
Do you prefer to stop loading native blocks that you won’t use? Or that you don’t want your client to see? Well, now you know how to unregister them with a little bit of code.
If you have any question, please leave it in the comments. And if you want to give me a suggestion for future snippets, please send it through the contact form.
Benefits of being a subscriber. 🙂