Managing media files in WordPress is usually straightforward—until something stops working. One common and frustrating issue users encounter is the inability to delete images from the WordPress Media Library. You click “Delete Permanently,” but nothing happens. Or worse, the image seemingly disappears but reappears after refreshing the page. If you’re facing this issue, don’t worry—you’re not alone, and there are proven solutions.
TLDR: If you can’t delete images in the WordPress Media Library, the issue is often caused by file permissions, plugin conflicts, theme problems, server restrictions, or database errors. Start by checking user roles and permissions, then troubleshoot plugins and themes. If the problem persists, inspect your hosting configuration, file permissions, or database integrity. Most deletion issues can be resolved with systematic troubleshooting.
Why You Can’t Delete Images in WordPress
When WordPress refuses to delete images, the issue usually falls into one of several categories:
- Insufficient user permissions
- Plugin or theme conflicts
- Incorrect file permissions (CHMOD settings)
- Server or hosting restrictions
- Media files in use by posts or pages
- Database inconsistencies
Understanding the root cause is key. Let’s walk through the most common fixes step by step.
1. Check Your User Role and Permissions
One of the simplest explanations is that your account doesn’t have permission to delete media files.
In WordPress, only users with the following roles can typically delete images:
- Administrator
- Editor (with some limitations depending on settings)
If you’re logged in as an Author or Contributor, you may only be able to delete files you personally uploaded—or not delete them at all.
Fix:
- Go to Users → All Users.
- Check your assigned role.
- Upgrade to Administrator temporarily if necessary.
Also verify that no custom plugin is restricting media capabilities.
2. Ensure the Image Isn’t Being Used
WordPress sometimes blocks deletion if the image is still attached to content.
Common scenarios include:
- The image is set as a Featured Image
- It appears inside a post or page
- It’s embedded in a product (WooCommerce)
- It’s being used by a page builder template
Fix:
- Edit the image from the Media Library
- Check the “Uploaded to” column
- Remove it manually from posts or templates
If you’re running a caching plugin, clear your cache after deletion attempts.
3. Check File Permissions (CHMOD Settings)
This is one of the most common technical causes. If the server restricts file access, WordPress cannot delete images stored in /wp-content/uploads/.
Proper file permissions typically look like:
- Folders: 755
- Files: 644
How to check:
- Access your site via FTP (FileZilla) or your hosting File Manager.
- Navigate to wp-content/uploads.
- Right-click a folder → File Permissions.
- Verify permissions are set correctly.
If files are set to 444 (read-only), WordPress will not be able to delete them.
Fix: Update permissions to 755 for folders and 644 for images.
4. Disable Plugins to Check for Conflicts
Plugins are incredibly useful—but they can also interfere with core functionality.
Media-related plugins that frequently cause conflicts include:
- Security plugins
- Media replacement plugins
- Offloading services (Amazon S3, Cloudflare R2)
- Optimization plugins (image compression tools)
Troubleshooting process:
- Go to Plugins → Installed Plugins.
- Deactivate all plugins.
- Try deleting the image.
- Reactivate plugins one by one to identify the culprit.
If you identify the problematic plugin, check for updates or contact the developer.
5. Switch Themes Temporarily
Though less common, themes—especially heavily customized ones—can affect media handling.
Fix:
- Switch to a default theme like Twenty Twenty-Six.
- Try deleting the image again.
- If successful, your theme may contain custom restrictions.
6. Investigate Server and Hosting Restrictions
Some hosting environments impose restrictions on file deletion.
Potential causes include:
- Insufficient disk space
- ModSecurity rules
- Ownership mismatches (server ownership vs FTP user)
- Object storage misconfiguration
If your images are offloaded to cloud storage, deleting them in WordPress may not remove the physical file.
Fix:
- Contact your hosting provider.
- Ask if file ownership needs correction.
- Verify there are no active ModSecurity rules blocking deletion requests.
7. Clear Media Library Cache
Sometimes, the image is actually deleted—but the Media Library interface doesn’t refresh properly.
Try this:
- Refresh the browser (Ctrl + F5)
- Clear server cache
- Clear CDN cache
- Clear object cache (Redis or Memcached)
If the image file no longer exists in /uploads/ but still shows in WordPress, the problem is likely database-related.
8. Fix Database Issues
When WordPress cannot properly remove image records from the database, the deletion process fails visually.
Common database-related issues:
- Corrupted media entries
- Orphaned metadata
- Broken attachment relationships
Fix Option 1: Use Built-in Repair Tool
Add the following line to your wp-config.php file:
define(‘WP_ALLOW_REPAIR’, true);
Then visit:
yourdomain.com/wp-admin/maint/repair.php
Run database repair.
Fix Option 2: Use a Database Optimization Plugin
Helpful Plugins for Cleaning Up Media Issues
Several tools can help resolve stubborn deletion problems.
| Plugin | Main Function | Best For | Ease of Use |
|---|---|---|---|
| Media Cleaner | Finds unused media files | Removing orphaned files | Beginner Friendly |
| WP Optimize | Database cleanup | Fixing metadata issues | Easy |
| Enable Media Replace | Replaces files without deleting | Updating images safely | Very Easy |
| Advanced Database Cleaner | Cleans orphan tables | Persistent database errors | Intermediate |
Important: Always back up your site before using cleanup plugins.
9. Manually Delete Images via FTP (Last Resort)
If WordPress refuses to delete an image through the dashboard, you can manually remove it.
Steps:
- Access your site via FTP.
- Navigate to wp-content/uploads/year/month/.
- Delete the file manually.
- Remove attachment entry via database or use Media Cleaner.
Be cautious—deleting files without cleaning database references can create broken links.
10. Check for Multisite Restrictions
If you’re using WordPress Multisite, deletion permissions may be restricted at the network level.
Super Admins typically control media library settings across all sites. If you’re a subsite admin, request elevated permissions.
Prevent Future Media Deletion Problems
Once you resolve the issue, take preventative measures:
- Keep WordPress core updated
- Regularly update plugins and themes
- Perform routine database maintenance
- Avoid installing too many media-related plugins
- Monitor file permissions after migrations
Regular backups are your safety net. Before major cleanups, always create a full backup.
Final Thoughts
When you can’t delete images in the WordPress Media Library, it may seem like a small issue—but it can signal deeper configuration problems. Fortunately, most cases are caused by permission conflicts, plugin interference, or caching glitches. By working methodically—checking user roles, file permissions, plugins, themes, and database integrity—you can identify and resolve the issue efficiently.
WordPress is powerful but layered. A small disruption in file access or database logic can ripple into strange behavior. The good news? Almost every deletion problem has a fix. Once resolved, your Media Library should function as intended—fast, clean, and fully under your control.
If you follow the steps outlined above, you’ll not only fix the issue—but also understand your WordPress environment better.