How to Allow WordPress Users to Delete Images and Files
By default, WordPress is very, very careful about who can delete files in your site’s Media Library.
Only users in the “Administrator” role are able to delete images and files in your Media Library. Anyone who is in the Subscriber, Contributor, Author and Editor roles is not allowed to delete images.
However, on some sites you may want to allow other users to clean your Media Library. Perhaps you have private files, or just have a cluttered Media Library with too many files.
The solution to deleting files is to install the PublishPress Capabilities plugin.
Once both those plugins are installed, go to “Capabilties” in your WordPress admin area.
In the right sidebar, check the “Media” box under “Force Type-Specific Capabilities”. This will allow you control the permissions for the Media Library,
In the top-left corner of the screen, load the user role that you want to customize permissions for. In this image below, I’ve chosen the “Editor” role (click here to read about Editors capabilities).
In the center of the screen, you can now set your permissions. If you want to allow people in this role to delete anything in your Media Library, go to the “Deletion” tab and check all the boxes in the “Media” row.
Click “Save Changes” at the bottom of the screen.
It’s as simple as that. Now whenever a user in the “Editor” role goes to the Media Library, they’ll see a “Delete permanently” option for any file they see:
To make this work, check out the the PublishPress Capabilities plugin. At that site, you’ll find more on this topic, including this post: “Which WordPress Users Can Delete Files From the Media Library?“
Steve, I am not sure about some of the information in this article. I am a WordPress admin and I recently added a new user with Editor role to add a few new pages. When I requested her to clean up the large number of images she added (most of which were not being used), she accidentally deleted most of the images from the Media Library. Suffice it to say, it took us some time and effort to get back to status quo. We don’t have any user plugins installed so we are using default WordPress functionality and it allowed this editor to delete the entire Media library!
Hi HM. It might be worth installing a plugin like Capablity Manager Enhanced and using it to double-check your permissions.
Any option to do this without a plugin?
Like other capabilities set in defining a role.
‘delete_posts’ => true,