You can scan all files that are in
uploads directory and see which ones are actually in Media Library and which ones are just sitting there. Then you can select files you want to import to the database and therefore make them available in Media Library.
You can also use FTP to upload your files to
uploads directory and bring those files into Media Library.
Please first try importing one file to see if it works.
This plugin is focused on scanning, selecting, and importing all files at once. So it might not be great for huge amounts of files, since it can use up a lot of memory. Future versions will hopefully solve that problem. For now, you can try to go to Settings -> Media Sync and set it to scan only a specific directory.
Also, please keep in mind that each WordPress installation is unique, so it’s quite possible this plugin will not work in your case. If that happens, please turn on debugging in settings of this plugin, try to figure out why you have that problem, and then describe what you found in the Support section. The more details we have, the more likely is the problem will be solved.
- various hidden files (.DS_Store, .htaccess),
- WP generated thumbnails (files ending with for example -100×100.jpg),
- WP generated scaled images (files ending with -scaled).
This is now configurable with a custom hook function and it can totally overwrite these rules or add additional ones.
media-sync directory to the
- Activate the plugin through the ‘Plugins’ menu in WordPress
Q: Stuck at importing / spins endlessly
A: Please try to increase
php.ini on server (as described here). Or if you have too many files, try going to Settings -> Media Sync and change “Scan directory” to some inner folder.
Q: Files not showing up in Media Library
A: Please make sure “Dry Run” option is NOT checked. This is a safety mechanism to make sure you know what you’re doing, so be careful, try it first with just one file.
Q: Doesn’t work
A: Please first try to turn on debugging by adding this:
define('WP_DEBUG', true); to your
wp-config.php and check Network tab in Chrome DevTools to see what is going on in the background. Then report actual errors since it’s hard to help without knowing the error which is causing the problem.
- Better error handling and fallback when finding mime type
- Fix meta data errors caused by invalid mime types
- Much better error handling while importing
- Optimized directory scanning to use less memory
- New option to turn on debugging for this plugin
- Changed parameters passed to
media_sync_filter_is_scan_object_ignored hook function
- Now requires PHP 5.5
- Fix handling big (“-scaled.jpg”) images introduced in WordPress 5.3. These files will now be skipped and won’t be imported multiple times.
- Add handy “Re-scan” button.
- Fix issues when importing files containing special characters
- Always convert backslashes (“\”) to forward slashes (“/”) to fix various issues when using Windows Server.
- Important backslash (“\”) vs forward slash (“/”) fix for use on Windows Server.
- New option to set “Scan directory” in settings which will allow checking only certain sub directory.
- New hook function
media_sync_filter_is_scan_object_ignored which can be used to overwrite which files are ignored by default or to just skip additional files.
- Fix Smart File Time on Windows server
- Reduce the maximum number of items to import per batch from 20 to 10.
So batch sizes are now: 1 (importing 1 to 10 items); 5 (importing 11 to 100 items) or 10 (importing more than 100 items)
- [IMPORTANT] Date of imported Media Library items now defaults to the current date.
But there are options to choose before importing and also a possibility to overwrite that using the custom hook.
- New options page with the option to disable and hide “Dry Run”.
- Fix Media Library filter that was showing all items when the filter didn’t find any result.
- Reduce the number of items to import per batch
- Support multisite network by changing required access capability from
- Another fix for get_current_screen error
- Fix get_current_screen error
- New option to clean up Media Library from items that are missing actual files (using custom Media Library filter)
- New filter when scanning uploads directory which can help to show only files missing from Media Library
- Fix PHP short array syntax
- Update required PHP version to 5.4
- Date of imported Media Library item is now set based on file modification timestamp
- Add plugin localization
- Add Serbian translation
- Various improvements and fixes
- Fix sorting of directories and files
- Minor wording changes and code cleanup
Example of selecting files for import
Import to Media Library in progress