How to Remove Customize from WordPress Admin Menu

WP Customization

A clean WordPress dashboard can significantly improve your workflow and reduce confusion, especially for clients. The “Customize” link, found under the “Appearance” menu, is a powerful tool. However, there are many situations where you might want to remove it. Perhaps you want to prevent clients from making accidental changes, or you simply want to streamline the admin area for specific user roles.

This guide will show you exactly how to remove the “Customize” link from the WordPress admin menu. We will explore a simple, code-based solution that is both effective and easy to implement. By following these steps, you can create a more controlled and user-friendly backend experience.

Why Remove the Customize Link?

Before we dive into the “how,” let’s quickly cover the “why.” The “Customize” option provides direct access to your theme’s settings, allowing users to change everything from colors and fonts to widgets and menus. While useful for administrators, it can be a source of potential issues in the wrong hands.

Here are a few common reasons to hide it:

  • Client-Proofing: You’ve handed a site over to a client and want to prevent them from breaking the design you carefully built.
  • User Role Management: You may want to restrict access for certain user roles, like “Editor” or “Author,” who don’t need to modify the site’s appearance.
  • Streamlining the UI: For users who only need to manage content, a simplified admin menu is less intimidating and more efficient.
  • White-Labeling: As part of a broader white-labeling strategy, you might remove several default WordPress menu items to create a branded experience.

Removing the Customize Menu Item with Code

The most reliable way to remove the “Customize” link is by adding a small snippet of PHP code to your site. This method gives you complete control and ensures the change persists even when themes or plugins are updated. You will add this code to your theme’s functions.php file.

Important: Before editing your functions.php file, it is highly recommended to use a child theme. If you add the code directly to your parent theme’s file, it will be overwritten and lost the next time you update the theme. Using a child theme ensures your customizations remain safe.

Step 1: Access Your Theme Files

First, you need to access your theme’s functions.php file. You can do this in two main ways:

  1. Through the WordPress Dashboard:
    • Navigate to Appearance > Theme File Editor.
    • If this is your first time, you may see a warning. Click “I understand” to proceed.
    • On the right side, under “Theme Files,” select your child theme.
    • Click on the file named functions.php to open it in the editor.
  2. Using an FTP Client or cPanel:
    • Connect to your website’s server using an FTP client (like FileZilla) or your hosting provider’s File Manager in cPanel.
    • Navigate to /wp-content/themes/your-child-theme-name/.
    • Locate the functions.php file and download it to your computer to create a backup.
    • Open the file in a text editor to make your changes.

Step 2: Add the PHP Code Snippet

Now that you have the functions.php file open, scroll to the bottom of the file. Copy and paste the following code snippet:

function remove_customize_admin_menu() {
global $submenu;
if (isset($submenu['themes.php'])) {
foreach ($submenu['themes.php'] as $index => $item) {
if ($item[2] == 'customize.php') {
unset($submenu['themes.php'][$index]);
}
}
}
}
add_action('admin_menu', 'remove_customize_admin_menu', 999);

Let’s quickly break down what this code does:

  • add_action('admin_menu', 'remove_customize_admin_menu', 999); This line hooks our custom function into WordPress when it builds the admin menu. The 999 priority ensures it runs after the menu is fully built.
  • function remove_customize_admin_menu() defines our function.
  • Inside the function, it accesses the global $submenu array, which holds all the submenu items.
  • It checks if the “Appearance” (themes.php) menu exists.
  • It then loops through the submenu items under “Appearance.”
  • If it finds the item that links to customize.php, it removes it using unset().

Step 3: Save Your Changes

After adding the code, save the functions.php file.

  • If you used the Theme File Editor, click the “Update File” button.
  • If you used FTP or cPanel, upload the modified file back to the server, overwriting the old one.

Now, refresh your WordPress dashboard. Navigate to “Appearance,” and you will see that the “Customize” link is gone!

Conditionally Removing the Menu for Specific Users

The code above will remove the “Customize” menu for all users. However, you might want to remove it only for certain users while keeping it for administrators. This is also simple to do.

You can modify the code to check for the user’s role or capabilities. Here is an example that removes the “Customize” link for everyone except for users with the manage_options capability (which is typically just administrators).

function remove_customize_for_non_admins() {
// Check if the current user can manage options.
// If they can, do nothing.
if (current_user_can('manage_options')) {
return;
}

// If they cannot manage options, remove the customize link.
global $submenu;
if (isset($submenu['themes.php'])) {
foreach ($submenu['themes.php'] as $index => $item) {
if ($item[2] == 'customize.php') {
unset($submenu['themes.php'][$index]);
}
}
}
}
add_action('admin_menu', 'remove_customize_for_non_admins', 999);

This modified snippet first checks if the current user has the ‘manage_options’ capability. If they do (meaning they are an admin), the function stops. If they don’t, it proceeds to remove the menu item. This is a much more practical approach for most use cases, as it protects the site from edits by non-admin users while preserving full control for you.

Conclusion

Customizing the WordPress admin area is a great way to create a more focused and secure environment for yourself and your users. When you need to remove the Customize from the WordPress admin menu, adding a simple function to your child theme’s functions.php file is the cleanest and most effective solution.

Whether you want to remove it for everyone or just for specific user roles, the process is straightforward. By taking this small step, you can prevent unwanted changes, reduce clutter, and build a more professional-looking backend for any WordPress website.

Leave a Reply

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