• I have a site where users can create accounts and upload posts (it’s a custom post type, not the wp standard post type). Currently, I have a problem with users not being able to delete their own posts. Users can click a link to delete a post, I’m using get_delete_post_link( get_the_ID() ); to do this. However, this only works for Admin roles. New users on the site get the Contributor role by default.

    I have the “Members” plugin and have checked for the Contributor role:
    – Edit posts
    – Delete posts
    – Publish posts
    – Delete private posts
    – Delete published posts
    – Edit private posts
    – Edit published posts

    I have also tried to give these rights through code and then specified the custom post type, but it’s the same result.

    What am I doing wrong? My understanding is that I should be able to give Contributors the right to remove their own posts.

    Thank you!

Viewing 6 replies - 1 through 6 (of 6 total)
  • Your roles & privileges might have got corrupt. You may want to reset the roles to default first and then refresh the backend and see if that works.

    To reset roles you can either try wp role reset --all command but if you don’t know much about that then you can try this plugin to reset the roles.

    • This reply was modified 3 years, 5 months ago by Samuel O..
    Moderator bcworkz

    (@bcworkz)

    Are you sure the post type was registered to use “*_posts” capabilities? It’s possible for post types to require their own unique capabilities like “delete_my-cpts”, etc.

    Thread Starter pend00

    (@pend00)

    @bcworkz I’ve made my custom post types with the Pods plugin. In the Pods settings for that custom post type, it was set to use Posts capabilities. I’ve changed it to have its own custom post type capabilities and selected the appropriate ones in Members, but it still doesn’t work.

    @wpcoworker I will try and see if that works. What will the outcome be? That the Contributor role will lose all capabilities or does it go deeper than that?

    Thank you for your replies.

    Thread Starter pend00

    (@pend00)

    If I give Contributors the right to “Manage Options” it works. What do Manage Options do? Would it be a risk to allow site users to have that right? I’m hiding the Dashboard menu bar at the top and they are not allowed to edit the dashboard.

    Moderator bcworkz

    (@bcworkz)

    I’d advise against allowing option management. It would give them access to all admin settings through the backend left side menu. Hiding it will deter a lot of users, but knowledgeable users can work around that.

    Manage options cap isn’t normally required to manage one’s own posts. I suspect your theme or a plugin is adding this requirement. It might make sense in certain situations, or it could be an accidental, unintentional restriction.

    Thread Starter pend00

    (@pend00)

    Thank you for your help! I’ll try to find another way, not using wp’s delete post link.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Contributor role cant remove post’ is closed to new replies.