WordPress.org

Ready to get started?Download WordPress

Forums

Remove/block part of the dashboard (3 posts)

  1. Eternal Sky Chaz
    Member
    Posted 3 years ago #

    Hey everyone,

    I want to remove part of the dashboard for a client's websites so they don't install plug-in by themselves and maybe muck up WP.

    What I want to hide/remove are the Plugins, Word Press Blog and Other WordPress News sections, but the rest of the dashboard can remain.

    Anyone else done this, or want to do this?

    Am using v3.0.1

    Thanks!

  2. David Sader
    Member
    Posted 3 years ago #

    Create a "mu-plugins" in your wp-content dir and add the following to a *.php file:

    <?php
    function ds_dashboard() {
    	if( current_user_can( 'read' ) ) {
    			remove_meta_box( 'dashboard_primary', 'dashboard', 'side' );
    			remove_meta_box( 'dashboard_secondary', 'dashboard', 'side' );
    		//	remove_meta_box( 'dashboard_incoming_links', 'dashboard', 'normal' );
    		//	remove_meta_box( 'dashboard_recent_comments', 'dashboard', 'normal' );
    		//	remove_meta_box( 'dashboard_right_now', 'dashboard', 'normal' );
    	}
    	if( current_user_can( 'edit_posts' ) ) {
    		//	remove_meta_box( 'dashboard_recent_drafts', 'dashboard', 'side' );
    		//	remove_meta_box( 'dashboard_quick_press', 'dashboard', 'side' );
    	}
    	if( current_user_can( 'activate_plugins' ) ) {
    			remove_meta_box( 'dashboard_plugins', 'dashboard', 'normal' );
    	}
    }
    add_action( 'admin_head', 'ds_dashboard' );
    ?>
  3. Eternal Sky Chaz
    Member
    Posted 3 years ago #

    Works perfectly!!!

    Thanks muchly!

Topic Closed

This topic has been closed to new replies.

About this Topic