• WordPress Menu with logo
    WordPress Snippets

    Hide a WordPress Admin Menu Based on User Role

    Sometimes there may be areas of the WordPress admin area that you do not want your users to have access to. For example, you may want editors to be able to edit the content of pages but not be able to add posts. There may be a custom post type that you have added that you do not want some users to have access to. It is fairly simple to add a snippet of code to your theme’s functions.php file that will check a user’s role or capabilities and remove menu items accordingly. Remove Admin Menu based on User Role. Once you have the above information you can create an…