{"id":285460,"date":"2026-03-05T01:19:48","date_gmt":"2026-03-05T01:19:48","guid":{"rendered":"https:\/\/wordpress.org\/plugins\/mcod-bulk-delete-media-by-content\/"},"modified":"2026-03-05T01:22:46","modified_gmt":"2026-03-05T01:22:46","slug":"mcod-bulk-delete-media-by-content","status":"publish","type":"plugin","link":"https:\/\/fa.wordpress.org\/plugins\/mcod-bulk-delete-media-by-content\/","author":20879654,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_crdt_document":"","version":"1.0.2","stable_tag":"1.0.2","tested":"6.9.4","requires":"5.0","requires_php":"7.4","requires_plugins":null,"header_name":"MCOD Delete Media by Content","header_author":"crleguizamon","header_description":"Delete media files (images, PDFs, attachments) linked to specific entry types in batches.","assets_banners_color":"398dac","last_updated":"2026-03-05 01:22:46","external_support_url":"","external_repository_url":"","donate_link":"https:\/\/www.paypal.com\/paypalme\/cristian18josue","header_plugin_uri":"","header_author_uri":"https:\/\/mcodform.com\/","rating":0,"author_block_rating":0,"active_installs":0,"downloads":186,"num_ratings":0,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","faq"],"tags":{"1.0.2":{"tag":"1.0.2","author":"crleguizamon","date":"2026-03-05 01:22:46"}},"upgrade_notice":[],"ratings":[],"assets_icons":{"icon-128x128.png":{"filename":"icon-128x128.png","revision":3475063,"resolution":"128x128","location":"assets","locale":""},"icon-256x256.png":{"filename":"icon-256x256.png","revision":3475063,"resolution":"256x256","location":"assets","locale":""}},"assets_banners":{"banner-1544x500-rtl.png":{"filename":"banner-1544x500-rtl.png","revision":3475063,"resolution":"1544x500","location":"assets","locale":""},"banner-1544x500.png":{"filename":"banner-1544x500.png","revision":3475063,"resolution":"1544x500","location":"assets","locale":""},"banner-772x250-rtl.png":{"filename":"banner-772x250-rtl.png","revision":3475063,"resolution":"772x250","location":"assets","locale":""},"banner-772x250.png":{"filename":"banner-772x250.png","revision":3475063,"resolution":"772x250","location":"assets","locale":""}},"assets_blueprints":{},"all_blocks":[],"tagged_versions":["1.0.2"],"block_files":[],"assets_screenshots":[],"screenshots":[],"jetpack_post_was_ever_published":false},"plugin_section":[],"plugin_tags":[2264,14810,3786,257137,84],"plugin_category":[50],"plugin_contributors":[245871],"plugin_business_model":[],"class_list":["post-285460","plugin","type-plugin","status-publish","hentry","plugin_tags-attachment","plugin_tags-bulk-delete","plugin_tags-cleanup","plugin_tags-delete-media","plugin_tags-media","plugin_category-media","plugin_contributors-crleguizamon","plugin_committers-crleguizamon"],"banners":{"banner":"https:\/\/ps.w.org\/mcod-bulk-delete-media-by-content\/assets\/banner-772x250-rtl.png?rev=3475063","banner_2x":"https:\/\/ps.w.org\/mcod-bulk-delete-media-by-content\/assets\/banner-1544x500-rtl.png?rev=3475063","banner_rtl":false,"banner_2x_rtl":false},"icons":{"svg":false,"icon":"https:\/\/ps.w.org\/mcod-bulk-delete-media-by-content\/assets\/icon-128x128.png?rev=3475063","icon_2x":"https:\/\/ps.w.org\/mcod-bulk-delete-media-by-content\/assets\/icon-256x256.png?rev=3475063","generated":false},"screenshots":[],"raw_content":"<!--section=description-->\n<p><strong>MCOD Delete Media by Content<\/strong> allows you to <strong>bulk delete WordPress media files<\/strong> attached to a specific post type. Whether you need to clean up orphaned images from deleted WooCommerce products, remove PDFs tied to a custom post type, or purge an unused media library section after a content migration, this plugin handles the process in batches.<\/p>\n\n<p>Use it to <strong>clean your WordPress media library<\/strong> without touching media that is actively used elsewhere on your site based on your exclusions.<\/p>\n\n<p><strong>Free Up Server Inodes:<\/strong>\nHosting servers have a limit on the number of files (inodes) they can store, regardless of disk space. Each WordPress attachment generates multiple thumbnail files, which rapidly consumes inodes. When the inode limit is reached, no new files can be created on the server. This plugin <strong>permanently deletes media files and all their generated thumbnails<\/strong> from the filesystem in batches, helping to <strong>reduce your inode count<\/strong> and restore your server's ability to handle new uploads.<\/p>\n\n<p><strong>Dual Detection Strategy:<\/strong>\nThis plugin uses a <strong>dual detection strategy<\/strong> to find media linked to your chosen post type by checking multiple fields:\n1. <strong>Direct Parent:<\/strong> Attachments whose <code>post_parent<\/code> points to a post of the selected type.\n2. <strong>Meta References:<\/strong> Attachment IDs stored in postmeta \u2014 including <strong>WooCommerce product galleries<\/strong> (<code>_product_image_gallery<\/code>), <strong>ACF Image &amp; Gallery fields<\/strong>, <strong>featured images<\/strong> saved as meta, and any other custom field referencing an attachment ID.<\/p>\n\n<p>This helps identify attachments properly without inadvertently affecting active media from other areas.<\/p>\n\n<p><strong>Smart Cross-Type Exclusions \u2014 Protect Shared Media:<\/strong>\nBefore deleting, the plugin cross-checks each attachment against other post types you select. If a product image is also used as a featured image on a Page or referenced in a Post, it will be <strong>automatically skipped<\/strong> \u2014 preventing broken images across your site.<\/p>\n\n<p><strong>Key Features:<\/strong><\/p>\n\n<ul>\n<li><strong>Bulk Delete by Post Type:<\/strong> Target Products, Pages, Posts, or any registered custom post type.<\/li>\n<li><strong>Media Type Filter:<\/strong> Scope deletion to Images only, PDFs, Videos, Audio, or all attachments.<\/li>\n<li><strong>Cross-Type Exclusions:<\/strong> Protect attachments shared with other post types from accidental deletion.<\/li>\n<li><strong>Preview Mode:<\/strong> Count and preview a sample of media to be deleted (with direct edit links) before running.<\/li>\n<li><strong>Safe Batch Processing:<\/strong> Processes in configurable batches of 1\u2013100 items to avoid PHP\/server timeouts on large media libraries.<\/li>\n<li><strong>Real-Time Progress Log:<\/strong> Live status updates so you always know what is happening.<\/li>\n<li><strong>WooCommerce &amp; ACF Compatible:<\/strong> Detects images in product galleries, ACF image\/gallery fields, and other postmeta.<\/li>\n<li><strong>Fully Translatable:<\/strong> Internationalization-ready with a <code>.pot<\/code> file included.<\/li>\n<\/ul>\n\n<p>\u26a0\ufe0f <strong>This plugin permanently deletes media files from the database and the server filesystem. Always create a full backup before running any deletion.<\/strong><\/p>\n\n<!--section=installation-->\n<ol>\n<li>Upload the <code>mcod-bulk-delete-media-by-content<\/code> folder to <code>\/wp-content\/plugins\/<\/code>.<\/li>\n<li>Activate the plugin via the 'Plugins' menu in WordPress.<\/li>\n<li>Go to <strong>Settings \u2192 Delete Media by Content<\/strong>.<\/li>\n<li>Select the <strong>Post Type<\/strong> (source) and <strong>Media Type<\/strong>.<\/li>\n<li>(Optional) Select <strong>Exclusions<\/strong> (hold Ctrl\/Cmd) to protect media shared with other content types.<\/li>\n<li>Click <strong>Count Media<\/strong> to see a preview of items to be deleted.<\/li>\n<li>Click <strong>Start Deletion<\/strong> to begin the cleanup process.<\/li>\n<\/ol>\n\n<!--section=faq-->\n<dl>\n<dt id=\"is%20this%20action%20reversible%3F\"><h3>Is this action reversible?<\/h3><\/dt>\n<dd><p>No. Media files are permanently deleted from the database and the server filesystem. <strong>Always back up your site<\/strong> before using this plugin.<\/p><\/dd>\n<dt id=\"what%20does%20%22linked%20to%20a%20post%20type%22%20mean%3F\"><h3>What does \"linked to a post type\" mean?<\/h3><\/dt>\n<dd><p>The plugin finds attachments in two ways:\n1.  <strong>Direct:<\/strong> The attachment's <code>post_parent<\/code> is a post of the selected type.\n2.  <strong>Reference:<\/strong> The attachment ID is found in the <code>postmeta<\/code> of the selected post type (e.g., WooCommerce product galleries, ACF fields).<\/p><\/dd>\n<dt id=\"can%20i%20exclude%20images%20used%20in%20other%20pages%3F\"><h3>Can I exclude images used in other pages?<\/h3><\/dt>\n<dd><p>Yes! Use the <strong>\"Exclude if also in\"<\/strong> field. Select the post types (e.g., Pages, Posts) you want to cross-check. If an image is found in your source but also referenced in an excluded type, it will NOT be deleted.<\/p><\/dd>\n<dt id=\"can%20i%20stop%20the%20process%20mid-way%3F\"><h3>Can I stop the process mid-way?<\/h3><\/dt>\n<dd><p>Yes. Click the <strong>Stop<\/strong> button to halt the process after the current batch finishes.<\/p><\/dd>\n<dt id=\"what%20batch%20size%20should%20i%20use%3F\"><h3>What batch size should I use?<\/h3><\/dt>\n<dd><p>The default of 20 is safe for most servers. If your server is powerful, you can increase it up to 100. If you experience timeouts, lower it.<\/p><\/dd>\n\n<\/dl>","raw_excerpt":"Bulk delete WordPress media files linked to any post type. Clean your media library in batches with smart exclusions and WooCommerce\/ACF support.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/fa.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/285460","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fa.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/fa.wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/fa.wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=285460"}],"author":[{"embeddable":true,"href":"https:\/\/fa.wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/crleguizamon"}],"wp:attachment":[{"href":"https:\/\/fa.wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=285460"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/fa.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=285460"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/fa.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=285460"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/fa.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=285460"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/fa.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=285460"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/fa.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=285460"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}