Media Sync


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 read before adding a support topic. Reviews are not intended for support or suggestions.

  1. “For developers”
    This plugin makes database changes (wp_posts and wp_postmeta tables), and it was primarily developed to help other developers that are aware of the consequences.

  2. “1 file first”
    Please be careful and try to import only one file first, to see if it works.

  3. “All at once”
    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.

  4. “Your setup is unique”
    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 – it’s more likely the problem will be solved.

Ignored files

  • index.php,
  • 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.


  • Initial Page
  • Example of selecting files for import
  • Import to Media Library in progress
  • Import completed


  1. Upload media-sync directory to the /wp-content/plugins/ directory
  2. Activate the plugin through the ‘Plugins’ menu in WordPress


Stuck at importing / spins endlessly

Please try to increase max_execution_time (and/or memory_limit) in 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.

Files not showing up in Media Library

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.

Doesn’t work

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.


2020년 11월 28일
I have committed my code to SVN including file in upload/, And on another machine checkout that SVN repo, all the files in the upload were present in that new machine, but wasn't showing under media menu. I used this plugin and within just 3 steps all my files were showing under media menu. Thanks! it saved my whole lot of trouble and time.
2020년 10월 26일
Besides working great as-is, I wanted to "auto-connect" my imported media to my WooCommerce Products via the SKU (which is in the filename). I saw a way to hook the plugin so I could do this. Erol was very receptive to the idea, and we got it done. If anyone has a similar need, let me know. My filter code might be useful to you.
2020년 10월 25일
The interface is a bit confusing and janky. It does at least tell you to backup your site first, although it would be nice to have a built in revert function. The real problem is that it doesn't generate the thumbnails of newly imported files, so you end up with a bunch of generic icons in your Media library. It's not an all-in-one solution.
2020년 10월 20일
Thanks so much for this, great plugin! Does what it says, easy config and great results.
2020년 10월 13일
The media sync plugin could only put a single directory in the media library. This can only be done so that the year 2012 was the name of the library and there was no subdirectory, but the pictures were in bulk. On the other hand, the name of 2012 / month appeared in the media, I was happy about that, because that's exactly what I wanted. Unfortunately, my joy was too soon, after which he refused to load any additional library into the media library in any form. He couldn't even map the other libraries.
2020년 9월 14일
What a lovely tool this is. So elegant and well thought it. It doesn't do a lot, but what it does it handles quite well. The interface is clear. The addition of the "Dry Run" checkbox tells me the author is a cautious and sensible person. 🙏 Note: given the complexity of the task, re-synching may not complete 100% the first attempt if you have many images. Thankfully, just run it again. It won't re-synch assets that have already been synched.
모든 38 평가 읽기

기여자 & 개발자

“Media Sync”(은)는 오픈 소스 소프트웨어입니다. 다음의 사람들이 이 플러그인에 기여하였습니다.


“Media Sync”(이)가 1(으)로 번역되었습니다. 기여해 주셔서 번역자님께 감사드립니다.

자국어로 “Media Sync”(을)를 번역하십시오.

개발에 관심이 있으십니까?

코드 탐색하기는, SVN 저장소를 확인하시거나, 개발 기록RSS로 구독하십시오.



  • New filter hook (media_sync_filter_before_update_metadata) which can be used to customize how metadata is updated or to run additional actions after file import.


  • Handle files with quotes (apostrophes) or other special characters in the file name.
  • Continue importing other selected files if there was an error with some of the files.
  • Show errors in UI instead of alert.


  • 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


  • Slight improvements with error handling in JavaScript


  • 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 update_plugins to import


  • 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


  • Fix error on activation


  • Initial plugin features