• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

WP SITES

2662

Original Genesis Tutorials & 5000+ Guaranteed Code

Snippets

  • Support
  • Newsletter
  • Videos
  • Log in

Premium Member? - Request custom code

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.

Roles & Capabilities

Reader Interactions

Leave a Reply Cancel reply

You must be logged in to post a comment.

Primary Sidebar

PHP Code

template_include

get_body_class

if else

array

class_exists

foreach

sprintf

add_action

printf

variable

Advertise · WPEngine · Genesis · Log in

  • How Premium Membership Works
  • Sign Up
  • Support
  • Subscription Details/Invoice
  • Tagged Tutorials
  • Access-Download Problems