Many users praise WordPress for its ease of use and streamlined administration interface. That being said, almost everyone who has deployed it to new users has instructed them to avoid certain menu items, as they do not need to enter these sections and could potentially introduce site malfunctions if they modify settings in these areas.
A better solution than prevention through training is to use a few simple API functions to hide the undesired menu items. This recipe shows how to use these functions to remove the Comments editor and Permalinks settings menu items.
- Navigate to the WordPress plugin directory of your development installation.
- Create a new directory called
ch3-hide-menu-item
. - Navigate to this directory and create a new text file called
ch3-hide-menu-item.php
. - Open the new file in a code editor and add an appropriate header at the top of the plugin file, naming the plugin
Chapter 3 - Hide Menu Item
. - Add...