Simplify Your WordPress Admin: Hide Unnecessary Toolbar Elements

How to hide menu items in wordpress admin; Remove unnecessary wordpress admin menu items; Hide wordpress admin bar items; Wordpress admin panel cleanup; Simplify wordpress admin menu; Wordpress admin menu customization; Hide wordpress dashboard elements; Wordpress admin menu editor plugin; Remove clutter from wordpress admin; Customize wordpress admin toolbar;

Explanation

Want to tidy up your WordPress admin area? Here's a simple way to hide those elements you don't need.

Remove Menu Items:

  • Get rid of menu items like Comments, Tools, Posts, Pages, and Media. This makes your admin menu less cluttered.

Clean Up the Admin Bar:

  • Remove the WordPress logo, Comments, New Content, and Updates from the admin bar. This keeps it neat and focused on what you need.

Streamline the Dashboard:

  • Hide widgets like Quick Draft, Recent Drafts, WordPress Events and News, and Activity. This helps you focus on the essentials.

Customize Further:

  • For example, you can hide the 'Help' tab to keep things simple.

These tweaks make your WordPress admin area cleaner and more efficient, helping you focus on what matters most.

Code

<?php
// Hook into 'admin_menu' to remove unnecessary admin menu items
function wp_dudecom_customize_admin_menu() {
    // Remove specific menu items
    remove_menu_page('edit-comments.php'); // Comments
    remove_menu_page('tools.php'); // Tools
    remove_menu_page('edit.php'); // Posts
    remove_menu_page('edit.php?post_type=page'); // Pages
    remove_menu_page('upload.php'); // Media
}
add_action('admin_menu', 'wp_dudecom_customize_admin_menu');

// Hook into 'wp_before_admin_bar_render' to remove unnecessary admin bar items
function wp_dudecom_customize_admin_bar() {
    global $wp_admin_bar;

    // Remove specific admin bar items
    $wp_admin_bar->remove_node('wp-logo'); // WordPress logo
    $wp_admin_bar->remove_node('comments'); // Comments
    $wp_admin_bar->remove_node('new-content'); // New content
    $wp_admin_bar->remove_node('updates'); // Updates
}
add_action('wp_before_admin_bar_render', 'wp_dudecom_customize_admin_bar');

// Hook into 'wp_dashboard_setup' to remove unnecessary dashboard widgets
function wp_dudecom_customize_dashboard_widgets() {
    // Remove specific dashboard widgets
    remove_meta_box('dashboard_quick_press', 'dashboard', 'side'); // Quick Draft
    remove_meta_box('dashboard_recent_drafts', 'dashboard', 'side'); // Recent Drafts
    remove_meta_box('dashboard_primary', 'dashboard', 'side'); // WordPress Events and News
    remove_meta_box('dashboard_secondary', 'dashboard', 'side'); // Secondary
    remove_meta_box('dashboard_activity', 'dashboard', 'normal'); // Activity
}
add_action('wp_dashboard_setup', 'wp_dudecom_customize_dashboard_widgets');

// Hook into 'admin_init' to customize the admin panel further
function wp_dudecom_customize_admin_panel() {
    // Example: Hide the 'Help' tab
    add_filter('contextual_help', '__return_false', 999);
}
add_action('admin_init', 'wp_dudecom_customize_admin_panel');
?>

Instructions

File Location: Add the following code to your theme's functions.php file or a custom plugin file.

Prerequisites:

  • Ensure you have access to your WordPress theme files or the ability to create/edit a custom plugin.
  • Backup your site before making changes to the code.

Implementation Steps:

  1. Log in to your WordPress admin dashboard.
  2. Navigate to Appearance > Theme Editor if you are editing the functions.php file, or go to Plugins > Add New to create a new plugin.
  3. If using the Theme Editor, select the functions.php file from the list on the right.
  4. If creating a new plugin, click on Create a new plugin and give it a name. Open the main plugin file for editing.
  5. Copy the provided code snippet and paste it at the end of the functions.php file or the main plugin file.
  6. Save the changes by clicking the Update File button if using the Theme Editor, or Save if using a plugin editor.
  7. Refresh your WordPress admin dashboard to see the changes take effect.

These steps will help you hide unnecessary elements from your WordPress admin area, making it cleaner and more efficient.

If you need further assistance or want to explore more advanced customizations, consider reaching out to wp-dude.com for expert help.