← Back to Tools Reference
Download Plugin
wp_delete_media
Description
Use this tool to permanently delete a file from your WordPress media library. Your AI will typically list or search media first to confirm the correct file ID before deletion. Use with care — media deletion in WordPress is permanent.
See it in action
Claude Desktop — MCP Connection
👤
Find all images uploaded more than 2 years ago that aren't attached to any post, and delete them.
🤖
Calling Tool: wp_delete_media
Done! I've used wp_delete_media to complete that for you.
{"status": "success"} Example Use Cases & Sample Prompts
- Removing obsolete files
- Prompt: “Find all images uploaded more than 2 years ago that aren’t attached to any post, and delete them.”
- Cleanup after redesign
- Prompt: “List all images with ‘old-logo’ in the filename and delete them.”
- Removing duplicates
- Prompt: “I accidentally uploaded ‘banner.jpg’ twice — find and delete the older duplicate.”
- Post-event cleanup
- Prompt: “Delete all images related to the ‘Christmas 2023’ promotion from the media library.”
- Storage cleanup
- Prompt: “List unattached media files and delete the ones that haven’t been used in any page or post.”
Access this tool today
Install the Easy MCP AI plugin to securely expose wp_delete_media to Claude, ChatGPT, and more.