How To Manage Client’s Admin Features of WordPress Website

What’s up guys, welcome back to another WordPress tutorial. This tutorial is about customizing your admin panel for your client. Maybe your client can change anything same as you. If the client can mess up with some important files, it will be a disadvantage for you. Because you will have to fix whatever the issue comes next. By the way,  most of the WordPress developers are using some plugins to limit some features from them. But it can be another security risk. So, today you can learn how to limit or hide admin panel features from your client.

To do this, you should be able to edit your core files. However, you can do this by using Appearance->Editor. But in this tutorial, I’m going to hide it first. So just use your core files. So let’s see how to do that.

  • Sign in to your CPanel and go to your WordPress installed directory.
  • Go to wp-content -> themes -> [your theme].
  • Then open functions.php.
  • At the end of the file, paste the following code to hide your editor.
define( 'DISALLOW_FILE_EDIT', true);
  • Now save it and go to your admin panel. (Make sure editor [Appearance->Editor] is not showing anymore. (IMPORTANT: Hiding this is helping to secure site on another side. Because some could hack into your site, he won’t be able to change your code.)

With above steps, you could hide your editor. But how we can hide other functions such as plugins, settings, appearance, posts, etc. OK let’s see how to do that. In here, I’ve provided a reference website about this functionality. You can check it also.

  • As above step, you can paste the following code to your functions.php. and make sure you’ve put this code without PHP tags.
function remove_menus(){
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
//remove_menu_page( 'wpcf7' );                    //contact form
}
if(current_user_can( 'editor' )){
add_action( 'admin_menu', 'remove_menus' );
}

By the way, after pasting the above code, you won’t see your Dashboard, Media, Pages, Comments, Appearance, Plugins, Users, Tools, and Settings sections in your panel. However, if you need something to show, just comment them by using two backslashes. The important thing is there is a code line called if(current_user_can( ‘editor’ )). You can change ‘editor’ if u need to remove above things from other roles.

Final Words

I hope, you learned how to change the admin panel for your clients. This is an essential thing if u want to make your other features hidden. If the client can see theme editor or some kind of other things, he can change anything and it will make you busy because of his fault. So just do this by using this method, and no need to worry about, what he is going to change.

Leave a Reply

Your email address will not be published. Required fields are marked *