Title: Plugin doesn&#8217;t follow default WordPress storage behavious
Last modified: August 12, 2025

---

# Plugin doesn’t follow default WordPress storage behavious

 *  Resolved [Oleg Burca](https://wordpress.org/support/users/olegburca/)
 * (@olegburca)
 * [10 months ago](https://wordpress.org/support/topic/plugin-doesnt-follow-default-wordpress-storage-behavious/)
 * I’m managing a large WordPress multisite.
   As there are over 300GB of uploads,
   I used a plugin to keep the uploads on a S3 Bucket and serve them under a separate
   subdomain.
 * It works fine for default uploads and most of the additional uploads, excepting
   Photo Gallery plugin.
   Instead of being uploaded to S3, they are kept locally 
   in a separate folder.
 * Is it possible to change the plugin behavior and make it leave the files placement
   to WordPress so they get into default uploads folder?
 * Thank you.

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

 *  Plugin Support [Nik](https://wordpress.org/support/users/nikitaanisimov/)
 * (@nikitaanisimov)
 * [9 months, 3 weeks ago](https://wordpress.org/support/topic/plugin-doesnt-follow-default-wordpress-storage-behavious/#post-18606556)
 * Hi [@olegburca](https://wordpress.org/support/users/olegburca/), Nik from 10Web.
   io here,
 * Thanks so much for your suggestion!
 * At the moment, our plugin’s default storage location is set to **wp-content/uploads/
   photo-gallery**, and this logic is built into its current structure. Unfortunately,
   it’s not possible to change this path, and we don’t have plans to introduce such
   a feature in our immediate roadmap.
 * We really appreciate your understanding, and if there’s anything else we can 
   assist with, please don’t hesitate to reach out.
 *  [citydet](https://wordpress.org/support/users/citydet/)
 * (@citydet)
 * [8 months, 2 weeks ago](https://wordpress.org/support/topic/plugin-doesnt-follow-default-wordpress-storage-behavious/#post-18655624)
 * Yes — what’s happening here is that the **Photo Gallery plugin is bypassing WordPress’s
   normal media API** and writing files directly into its own folder. That’s why
   your offloading-to-S3 plugin never gets a chance to intercept the upload.
 * In WordPress, the usual flow is:
    - Files are uploaded via `wp_handle_upload()` → `wp_upload_dir()` → Media Library.
    - Your S3/offload plugin hooks into those functions, swaps the storage location,
      and rewrites the URLs.
 * But Photo Gallery (and some other gallery plugins) does this instead:
    - Creates its own folder (e.g. `/wp-content/gallery/...`)
    - Moves files there directly with PHP file functions, ignoring WordPress’s APIs.
 * 🔧 Your Options
    1. **Check plugin settings first**
    2.  - Some gallery plugins (including Photo Gallery by 10Web, for example) have
          an option like _“Use WordPress Media Library”_ or _“Store in Uploads”_. If
          enabled, all images go through the normal uploads folder, which your S3 plugin
          can then offload.
    3. **Code-level workaround**
    4.  - If no such option exists, you’d need to hook into the plugin’s upload process
          and filter the upload path. Typically, WordPress allows overriding upload
          directories with the `upload_dir` filter. But since Photo Gallery bypasses
          this, you’d need to either:
           * Override its file-saving function via `add_filter` or `add_action` if 
             available.
           * Or modify the plugin so it calls `wp_handle_upload()` instead of `move_uploaded_file()`.
    5. **Indirect approach (sync local → S3)**
    6.  - If rewriting the plugin isn’t viable, you can still configure your offload
          plugin to **scan additional directories** or run a cron job that syncs the
          gallery folder to S3. Many S3 plugins (e.g. WP Offload Media) have filters
          like `as3cf_upload_attachment` where you can extend their scope.
    7. **Plugin replacement**
    8.  - If the plugin doesn’t offer hooks and modifying it is too brittle, consider
          switching to a gallery plugin that fully integrates with the WordPress Media
          Library (NextGEN Gallery, Envira Gallery, etc.), so your S3 solution just
          works.
 * ✅ **Best long-term solution**: Check if your Photo Gallery plugin has an option
   to use the Media Library. If yes, turn it on → everything will offload automatically.
   
   ⚡ If not, you’ll need either custom development (force it through WordPress’s
   media upload functions) or extend your S3 plugin to watch the gallery’s folder
   too.

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

The topic ‘Plugin doesn’t follow default WordPress storage behavious’ is closed 
to new replies.

 * ![](https://ps.w.org/photo-gallery/assets/icon-256x256.png?rev=2068745)
 * [Photo Gallery by 10Web - Mobile-Friendly Image Gallery](https://wordpress.org/plugins/photo-gallery/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/photo-gallery/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/photo-gallery/)
 * [Active Topics](https://wordpress.org/support/plugin/photo-gallery/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/photo-gallery/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/photo-gallery/reviews/)

 * 2 replies
 * 3 participants
 * Last reply from: [citydet](https://wordpress.org/support/users/citydet/)
 * Last activity: [8 months, 2 weeks ago](https://wordpress.org/support/topic/plugin-doesnt-follow-default-wordpress-storage-behavious/#post-18655624)
 * Status: resolved