Remove Capabilities For Any User Role

WordPress enables you to remove any capabilities pre assigned to any user role.

In this 1st example, the code removes specific capabilities for the editors role preventing all editors from deleting any posts and pages.

If you want to use this code for another role, simply change all instances of editor in the code to the name of any other role.

The 2nd example below prevents users assigned the author role from deleting any posts

Another way to control what your users can and cannot access is to remove specific admin menu links for a specific user.

Was This Tutorial Helpful?

Free

$0

Access only to all free tutorials per month.



Monthly

$75

Access to 10 premium tutorials per month.


Tutorial Request


Includes code guarantee and coding support.

Yearly

$500

Access to 15 premium tutorials per month.


Monthly Tutorial Request


Includes code guarantee and priority coding support.