Removing or Restricting Access to Page Templates for Editor Role

Here is a solution to remove that metabox from the edit page – this solution also assumes that the editors don’t have access to edit themes.

add_action( 'admin_menu', 'restrict_access' );
function restrict_access() {
if(!current_user_can('edit_themes')){
    remove_meta_box( 'pageparentdiv', 'page','normal' );
    }
}

Hope this helps

Leave a Comment