Title: Non-Admin Roles Cannot Delete Custom Posts
Last modified: March 8, 2023

---

# Non-Admin Roles Cannot Delete Custom Posts

 *  [Will](https://wordpress.org/support/users/willbeing/)
 * (@willbeing)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/non-admin-roles-cannot-delete-custom-posts/)
 * We have a site that has custom roles. These roles (trial, member) have been granted
   the capabilities `delete_posts` and `delete_published_posts`.
 * We then use a simple link to allow users to delete their own posts:
 *  `<a onclick="return confirm('Are you sure you want to delete this scanner?')"
   class="btn btn-outline-danger w-100" href="<?php echo get_delete_post_link( $
   post->ID ) ?>">Delete Custom Scanner</a>`
 * Unfortunately, this only works for admins. For any other users, it redirects 
   to the home page without deleting the post.
 * Does anyone know what is incorrect here? Thank you!
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fnon-admin-roles-cannot-delete-custom-posts%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 1 replies (of 1 total)

 *  Moderator [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * (@bcworkz)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/non-admin-roles-cannot-delete-custom-posts/#post-16545385)
 * You’re saying that roles with delete_posts and delete_published_posts are not
   working with custom posts for non-admin roles that have these? Are they able 
   to delete regular built-in posts? If so, it may be your custom posts require 
   custom capabilities to match.
 * If they cannot even delete their own built-in posts, then they have inadequate
   capabilities. TBH, I’m unsure what’s truly needed. What you can do is add all
   plausible capabilities that relate to managing posts to trial and member roles.
   Then they should be able to delete. Next, remove capabilities you suspect are
   not required, one by one, until they can no longer delete again. Each time deletion
   again fails, restore what you just removed, it was needed. The goal being to 
   provide everything needed and nothing that is not needed by process of elimination.
 * Full list of default admin capabilities is here:
    [https://wordpress.org/documentation/article/roles-and-capabilities/#administrator](https://wordpress.org/documentation/article/roles-and-capabilities/#administrator)

Viewing 1 replies (of 1 total)

The topic ‘Non-Admin Roles Cannot Delete Custom Posts’ is closed to new replies.

## Tags

 * [delete posts](https://wordpress.org/support/topic-tag/delete-posts/)
 * [posts](https://wordpress.org/support/topic-tag/posts/)
 * [remove posts](https://wordpress.org/support/topic-tag/remove-posts/)

 * In: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
 * 1 reply
 * 2 participants
 * Last reply from: [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * Last activity: [3 years, 3 months ago](https://wordpress.org/support/topic/non-admin-roles-cannot-delete-custom-posts/#post-16545385)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
