Quantcast
Channel: dadmin – Dipak C. Gajjar
Viewing all articles
Browse latest Browse all 10

Customize WordPress Dashboard for clients

$
0
0

Dipak C. Gajjar

Customize WordPress Dashboard for clients

To keep your clients from risky places or to restrict access to specific pages from the clients, you can customize your WordPress dashboard by adding the below code in your theme's functions.php. This code allows you to hide parts of the WordPress dashboard menu.

function dcg_customise_dashboard() {
    // 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', 'dcg_customise_dashboard' );

You need to uncomment the line ( remove // ) for the page that you want to hide/remove from the WordPress menu.

Be aware that this only hides the menu items from the dashboard and clients can still theoretically access these menus with a direct link (if they know).

The post Customize WordPress Dashboard for clients first appeared on Dipak C. Gajjar and is written by dadmin.


Viewing all articles
Browse latest Browse all 10

Trending Articles