How To Hide an Element/Div/Button from WordPress Admin Panel

If you a WordPress developer and working on many client projects, quite often you may have thought about hiding a button in the admin panel so that the clients cannot see it. It can be like hiding some plugins, error messages from the theme (if you didn’t purchase), some extra features, theme, or even you can hide the entire plugins page. User roles is a good option in WordPress is good. But sometimes we need something beyond that.


From this tutorial, you will learn how to remove or hide elements or buttons from the admin panel for WordPress. Don’t worry that it will be hidden from your side too, there is an option for that.

Hide an Element for all Users

  1. Copy the element’s CSS path by inspect element
    Right-click the element you want to hide -> Inspect element ->Right click on the div -> Copy -> Copy selector. It will copy the CSS path
  2. Copy the below code to functions.php. You can find that in Appearance -> Editor -> Theme Functions (functions.php) in right sidebar
  3. Replace [css-path] with the CSS path you have copied.

Hide an Element to a Specific User

The below code can be used to hide element for a specific user. For example hiding theme panel from a [username] who is admin

Hide an Element Only for You

What if you want to hide something only for you? Sounds crazy? Every time I login to my admin panel, it says you have to buy the theme! 😀 So I just removed that ;). You can use the stylebot chrome extensions to hide elements temporarily.

How to Show an Element that you have Hidden

What if you want to show the elements that I have put “display:none”? There is a chrome extension for that too. You can use Web Developer chrome extension. Install the extension -> Open it -> Miscellaneous -> Display hidden elements