Title: Allowed Memory Size error
Last modified: February 15, 2020

---

# Allowed Memory Size error

 *  Resolved [johnmf09](https://wordpress.org/support/users/johnmf09/)
 * (@johnmf09)
 * [6 years, 3 months ago](https://wordpress.org/support/topic/allowed-memory-size-error-4/)
 * I have been using the plugin with no problems until now, I have approx 42,000
   images in the media library and when I click on the scan files button I get a
   memory error. I have tried increasing the allowed memory in the wp-config and
   the php.ini and still getting the same problem.
    Suggestions? Thanks John

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Author [erolsk8](https://wordpress.org/support/users/erolsk8/)
 * (@erolsk8)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/allowed-memory-size-error-4/#post-12559869)
 * Hi John, sorry, I missed this topic.
 * I’d try the same things as you did, so I can’t think of something else you can
   do on your side.
 * It will probably need to “scan” just the first level of folders, and then “scan”
   more as folders are expanded. But then selecting all and importing all would 
   also need to be changed.
    Or easier change would be to have the option to define
   which folder to scan.
 * I’ll have to find some time to see if I can improve it.
 * Thanks
 * Erol
 *  Plugin Author [erolsk8](https://wordpress.org/support/users/erolsk8/)
 * (@erolsk8)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/allowed-memory-size-error-4/#post-12568999)
 * Hi [@johnmf09](https://wordpress.org/support/users/johnmf09/),
 * Currently, there is no quick way to improve this plugin to properly scan only
   certain directories, in a way it’s explained in my previous comment. That might
   come later.
 * But for now, I pushed a small update which will allow setting which sub-directory
   to scan with custom URL. So to scan only this year, you can try adding something
   like this to the URL:
 *     ```
       /wp-admin/upload.php?page=media-sync-page&scan_files=1&sub_dir=2020
       ```
   
 * or even just a certain month:
 *     ```
       /wp-admin/upload.php?page=media-sync-page&scan_files=1&sub_dir=2020/03
       ```
   
 * It’s hacky, but this is as much as I could do for now.
 * Please let me know if it works for you. If something like this would even be 
   helpful in your case 🙂
 *  Plugin Author [erolsk8](https://wordpress.org/support/users/erolsk8/)
 * (@erolsk8)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/allowed-memory-size-error-4/#post-12660946)
 * Another update [@johnmf09](https://wordpress.org/support/users/johnmf09/) 🙂
 * I just pushed a new version (1.1.3), so instead of that hacky URL trick, you 
   can now go to Settings -> Media Sync and set which folder to scan. I’m imagining
   you can set it to use only `2020` which would have fewer files and won’t reach
   memory limit.
 * Please let me know if it helped, but I’m closing this topic for now. We can reopen
   if needed.
 * Thanks
    Erol

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Allowed Memory Size error’ is closed to new replies.

 * ![](https://ps.w.org/media-sync/assets/icon.svg?rev=2021152)
 * [Media Sync](https://wordpress.org/plugins/media-sync/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/media-sync/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/media-sync/)
 * [Active Topics](https://wordpress.org/support/plugin/media-sync/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/media-sync/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/media-sync/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [erolsk8](https://wordpress.org/support/users/erolsk8/)
 * Last activity: [6 years, 1 month ago](https://wordpress.org/support/topic/allowed-memory-size-error-4/#post-12660946)
 * Status: resolved