WordPress.org

Support

Support » How-To and Troubleshooting » Restricting Post Deletion Capability for All User roles

Restricting Post Deletion Capability for All User roles

  • I want to restrict the ability for all user roles to delete a post (for client compliance reasons). I’m in a MS isntallation, and I don’t want to use a plugin.

    Using the following code in functions.php:

    $wp_roles->remove_cap( 'administrator', 'delete_posts' );
    $wp_roles->remove_cap( 'editor', 'delete_posts' );
    repeat with every role...

    Not working, and I’m wondering if I’m not using the hook correctly. Any help is appreciated!

  • The topic ‘Restricting Post Deletion Capability for All User roles’ is closed to new replies.
Skip to toolbar