Which WordPress Users Can Delete Files From the Media Library?
You won't be surprised to learn that WordPress is very, very careful about who can delete media files.
Only Administrators are able to delete images and files in your Media Library.
Anyone who is a Subscriber, Contributor, Author and Editor roles is not permitted to delete media items.
What permissions are given to the default WordPress roles?
If you're not sure what I mean when I describe “Subscriber, Contributor, Author and Editor”, then check out these links:
- What permissions do Subscribers have in WordPress?
- What permissions do Contributors have in WordPress?
- What permissions do Authors have in WordPress?
- What permissions do Editors have in WordPress?
How to change who can delete media files
If you want to change who is allowed to delete files, I recommend that you install the PublishPress Capabilities plugin.
- Go to “Capabilities” in your WordPress admin area.
- In the top-left corner of the screen, load the user role that you want to customize. In this image below, I've chosen the “Editor” role:
- Also in the right sidebar, and check the “Media” box under “Type-Specific Capabilities”. Doing this will allow you control the permissions for the Media Library,
In the center of the screen, you can now set the permissions. If you want to allow people in the Editor role to delete anything in your Media Library, 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” link for any file they see:
Hi. I have installed pure wordpress 5.9.1 and unfortunately by default there is no protection against deleting files, no matter if I am an administrator or not, I can delete all files. So does the free version of the plugin have any impact on the media folder?
Hi Thomas. Our plugin can protect the media folder if you enable those features.