Remove WordPress Menu and Logo from wp-admin panel

To remove the WordPress menu and logo from the wp-admin panel, you’ll need to add a custom function to your theme’s `functions.php` file. Here’s how you can do it:

Step 1: Access Your Theme’s Functions File

  1. Log in to your WordPress dashboard.
  2. Navigate to Appearance > Theme Editor.
  3. On the right-hand side, find and click on `functions.php`.

Step 2: Add Custom Code

Add the following code snippet to the bottom of your `functions.php` file or you can directly add through Code Snippets plugin:

Remove WordPress Menu Items

To remove certain menu items, use the following code:

function customize_admin_menu() {
    // Example to remove 'Posts' menu item
    remove_menu_page('edit.php');
    // Example to remove 'Media' menu item
    remove_menu_page('upload.php');
    // Add more remove_menu_page() calls as needed
}
add_action('admin_menu', 'customize_admin_menu');

To remove the WordPress logo from the admin bar, use the following code:

function customize_admin_bar() {
    global $wp_admin_bar;
    $wp_admin_bar->remove_node('wp-logo'); // Removes WordPress logo
}
add_action('wp_before_admin_bar_render', 'customize_admin_bar');

Step 3: Save Your Changes

Once you’ve added the code, click Update File to save your changes.

Notes:

  • Be cautious while editing the `functions.php` file. Incorrect code can break your site.
  • It’s a good idea to back up your site before making any changes.
  • Consider using a child theme for customizing functionality, so your changes aren’t lost during theme updates.
  • The `remove_menu_page()` function requires the slug of the menu item you wish to remove (e.g., `’edit.php’` for Posts).

By using these code snippets, you can customize the wp-admin panel to better fit your needs, keeping it clean and focused only on the functionality you require.

Exclusive Bonus (Free Book + Shipping Fees)

Similar Posts