how do i remove items from the side menu for authors?

https://preview.redd.it/gt7116ldmw7d1.png?width=201&format=png&auto=webp&s=b484d735ee53c5f91f10500cafb34b3659d4dabc

like the title says, i want my authors to only see the “Posts” and “Media” menu items. i already locked down the tools and site settings so they get an “not authorised” message when they click on them. but i want the options to be gone from their menu. i work with some less then IT savvy authors and the whole process of creating a post needs to be as simple as possible. having menu options that they don’t need will just confuse them.

edit; some items like plugins and pages are already not available, so is there some place i can add all the other items?

1 Comment
  1. something like this:

    function remove_menus_for_authors() {

    // Check if the current user is an author

    if (current_user_can(‘author’) && !current_user_can(‘administrator’)) {

    // Remove unnecessary menu items

    remove_menu_page(‘index.php’); // Dashboard

    remove_menu_page(‘edit.php?post_type=page’); // Pages

    remove_menu_page(‘upload.php’); // Media

    remove_menu_page(‘edit-comments.php’); // Comments

    remove_menu_page(‘themes.php’); // Appearance

    remove_menu_page(‘plugins.php’); // Plugins

    remove_menu_page(‘users.php’); // Users

    remove_menu_page(‘tools.php’); // Tools

    remove_menu_page(‘options-general.php’); // Settings

    }

    }

    add_action(‘admin_menu’, ‘remove_menus_for_authors’);

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer