Skip to main content

How to hide WordPress admin toolbar on the frontend?

Vasyl MartyniukBackend AccessLess than 1 minute

To restrict access to the admin toolbar for any role or user follow these steps:

  • Go to the AAM page and switch to manage the "Administrator" role on the "Users & Roles" widget.
  • Navigate to the "Capabilities" tab and select "Create" button.
  • In the "Create Capability" modal enter aam_show_toolbar capability and select "Create". If you have the "Administrator" role then you can uncheck "Also assign this capability to me" to avoid redundancy. For more information refer to the How to create a custom capability?.

From this point on, all the roles and users that do not have this capability explicitly assigned, will not be able to see admin toolbar on the frontend.