Hiding the Custom Field section in the post editor
After having full control over which meta boxes are shown when creating custom post type editor controls and putting together plugin configuration pages, things are a little different when it comes to altering the basic post and page editors. More specifically, instead of choosing which meta boxes to display, the editor sections created by WordPress need to be removed to tailor the user experience.
This recipe shows how to remove the Custom
Fields
meta boxes from the post and page editors:

Getting ready
You should have access to a WordPress development environment, either on your local computer or a remote server, where you will be able to load your new plugin files.
How to do it...
- Navigate to the WordPress plugin directory of your development installation.
- Create a new directory called
ch5-hide-custom-fields
.
- Navigate to this directory and create a new text file called
ch5-hide-custom-fields.php
. - Open the new file in a code editor and add an...