How Hide WordPress Admin Menus Options Editor Code For Clients

WordPress is a wonderfully powerful CMS that ships with many versatile features giving it the flexibility to work out of the box for a wide range of users. You would like to customize the WordPress admin menu to hide some menu option, even hide certain features. Whatever the reason, you can alter and rearrange how the WordPress admin menu appears.

The same features and options that allow off-the-shelf themes to adapt to many different use cases, in this tutorial, I’ll show you a quick and easy way to customize the WordPress admin menu to your liking, with carefully designed custom theme built for a specific use case.

Hide WordPress Admin Menus Options

Disable Theme Editor Option

Some reason anyone should be disable theme edit option from WordPress dashboard, add one line of code.

Go to wp-content -> themes -> YOUR ACTIVATED THEME -> functions.php

define( 'DISALLOW_FILE_EDIT', true );
Disable Theme Editor Option

Disabling the Visual Editor

WYSIWYG editor will disappear, this write only HTML or text plane text.

Disabling the Visual Editor

Go to wp-content -> themes -> YOUR ACTIVATED THEME -> functions.php

function emersonthis_disable_visual_editor(){
# add logic here if you want to permit it selectively
return false;
}
add_filter('user_can_richedit' , 'emersonthis_disable_visual_editor', 50);
Disabling the Visual Editor after

Hide Unused Dashboard Menu Items

Hide Unused Dashboard Menu Items

Not every site has the same types of content, you can hide admin menu items from specific users in WordPress. This lets you choose certain roles and capabilities of users who can access the menu. so let’s remove it by adding the following snippet.

Go to wp-content -> themes -> YOUR ACTIVATED THEME -> functions.php

function emersonthis_custom_menu_page_removing() {
// remove_menu_page( 'index.php' );                  //Dashboard
remove_menu_page( 'jetpack' );                    //Jetpack* 
remove_menu_page( 'edit.php' );                   //Posts
remove_menu_page( 'upload.php' );                 //Media
remove_menu_page( 'edit.php?post_type=page' );    //Pages
remove_menu_page( 'edit-comments.php' );          //Comments
remove_menu_page( 'themes.php' );                 //Appearance
remove_menu_page( 'plugins.php' );                //Plugins
remove_menu_page( 'users.php' );                  //Users
remove_menu_page( 'tools.php' );                  //Tools
remove_menu_page( 'options-general.php' );        //Settings
}
add_action( 'admin_menu', 'emersonthis_custom_menu_page_removing' );
Hide Unused Dashboard Menu Items

If you want if else statement like disable edit user, replace a line of code.

if(current_user_can('editor')){
add_action( 'admin_menu', 'emersonthis_custom_menu_page_removing' );
}

Change administrator no able to access all option to editor replace to this code.

if(current_user_can('administrator')){
add_action( 'admin_menu', 'emersonthis_custom_menu_page_removing' );
}

NOTE

Customizing the WordPress admin menu is a great way to help you keep materials organized. Having quick and easy hide some feature to your client only improves and security reasone. Customizing the WordPress menu for clients is a really nice touch that can really give your finished product a polished look. You can make site management for your clients simple by prioritizing the important links.

If you have any questions, post in the comments section!

Other Popular Articles...

Leave a Comment