When I move a site to a new host, I need to make sure I have all the media files.
When I’m redoing a website (for example, making a site that hasn’t been updated in a long time, or got hacked, brand new), I want to eliminate images and videos that are no longer needed, and have the size images needed for the theme (desktop wide monitor, tablet, mobile phone sizes).
Check Missing Media Files
In WordPress, there are several plugins and methods available to check for missing media files. One such plugin is “Media Cleaner,” which helps clean up your WordPress media library by deleting unused media entries and files, as well as fixing broken entries. This plugin can scan your physical /uploads directory and match it against the Media Library, providing a comprehensive overview of which files you can delete and clean up.
Another option is the “Unused Media Checker” plugin, which helps identify, inspect, and safely remove unused media files from your WordPress Media Library. It lists all attachments not used in posts, pages, or as featured images and integrates with AdvancedAds to exclude media used in ads automatically.
Additionally, the “Media Sync” plugin can be used to scan the “uploads” directory and bring those files into the Media Library. This can help ensure that all media files are properly recognized and available in the Media Library.
If you prefer a more manual approach, you can use SQL queries to find unattached media files or check the post_status column in the _posts table of your database to ensure that the status is set correctly. You can also regenerate thumbnails using plugins like “Force Regenerate Thumbnails” to resolve issues with missing images.
Media Cleaner: Clean your WordPress! – WordPress plugin | WordPress.org
Images in media library have suddenly disappeared – WordPress Development Stack Exchange
How to Fix Missing Images in WordPress – GlowFrog Hosting
Media Sync – WordPress plugin | WordPress.org
Unused Media Checker – WordPress plugin | WordPress.org
Media files exist in upload folder but not showing up – WordPress Development Stack Exchange