Title: Plugin breaks custom uploads folder
Last modified: March 15, 2024

---

# Plugin breaks custom uploads folder

 *  Resolved [Michael Brütsch](https://wordpress.org/support/users/nailedit/)
 * (@nailedit)
 * [2 years, 2 months ago](https://wordpress.org/support/topic/plugin-breaks-custom-uploads-folder-2/)
 * I’m not sure with which version exactly this problem began, because I just now
   updated because of the security issue ([https://patchstack.com/database/vulnerability/kadence-blocks/wordpress-gutenberg-blocks-by-kadence-blocks-page-builder-features-plugin-3-2-23-authenticated-contributor-stored-cross-site-scripting-vulnerability?_a_id=350](https://patchstack.com/database/vulnerability/kadence-blocks/wordpress-gutenberg-blocks-by-kadence-blocks-page-builder-features-plugin-3-2-23-authenticated-contributor-stored-cross-site-scripting-vulnerability?_a_id=350))
 * But the plugin now breaks my custom upload folder, defined with this code:
 * `define('UPLOADS', 'my-custom-folder');`
 * And I’m 100% sure it is because of this plugin. As soon as I deactivate the plugin,
   the images and other files work. When this plugin is activated, it somehow overwrite
   my custom upload folder and starts using /wp-content/uploads/ again.
 * Please tell me how I can fix this as soon as possible, because I don’t really
   want to use an insecure version…
 * UPDATE/INFO: I installed version 3.1.26, and in this version I don’t have the
   problem. Maybe this helps to narrow down the problem.
    -  This topic was modified 2 years, 2 months ago by [Michael Brütsch](https://wordpress.org/support/users/nailedit/).

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

 *  Plugin Contributor [Gilbert Hernandez](https://wordpress.org/support/users/ghernkadence/)
 * (@ghernkadence)
 * [2 years, 2 months ago](https://wordpress.org/support/topic/plugin-breaks-custom-uploads-folder-2/#post-17509781)
 * Hello [@nailedit](https://wordpress.org/support/users/nailedit/),
 * When you say, “…the plugin now breaks my custom upload folder…” what do you mean?
   Do you get an error when you try to upload files? Or do files not appear on the
   front end? Do you see errors, or do files just not upload to your desired location?
   When you disable the Kadence Blocks plugin, you mentioned that the image and 
   other files work. However, I’m trying to understand how it breaks and how it 
   appears when it works.
 *  Thread Starter [Michael Brütsch](https://wordpress.org/support/users/nailedit/)
 * (@nailedit)
 * [2 years, 2 months ago](https://wordpress.org/support/topic/plugin-breaks-custom-uploads-folder-2/#post-17509949)
 * I mean, that when the Kadence Blocks plugin is active, the whole site acts as“
   wp-content/uploads” is the default folder, instead of “my-custom-folder” (like
   ignoring the “define(‘UPLOADS’, ‘my-custom-folder’);” in my wp-config.php file).
 * Meaning: New files/images are uploaded to “wp-content/uploads”. And all my existing
   files and images are not working anymore, because WordPress thinks the path is
   for example “wp-content/uploads/my-image.jpg”, while the actual file on the server
   is still in “my-custom-folder/my-image.jpg”.
 * So no real error message, just the wrong path.
 * By the way: Sorry for the double posting ([https://wordpress.org/support/topic/plugin-breaks-custom-uploads-folder/](https://wordpress.org/support/topic/plugin-breaks-custom-uploads-folder/)),
   my first post was at first flagged for review and then completely deleted, but
   now somehow still published.
 *  Plugin Contributor [Gilbert Hernandez](https://wordpress.org/support/users/ghernkadence/)
 * (@ghernkadence)
 * [2 years, 2 months ago](https://wordpress.org/support/topic/plugin-breaks-custom-uploads-folder-2/#post-17512330)
 * Hello [@nailedit](https://wordpress.org/support/users/nailedit/),
 * I recreated the scenario you described, and everything appears to work as expected.
   When you add the `define('UPLOADS', 'my-custom-folder');` line to the config 
   file, my files upload to the ‘my-custom-folder’ beside the wp-content folder.
   However, the images I’ve uploaded previously are not in the ‘my-custom-folder’
   so they can’t be accessed by the media library.
 * However, all newly uploaded images appear in the ‘my-custom-folder’ and can be
   accessed by the media library. This behavior is the same whether Kadence Blocks
   is activated or not.
 * To solve the problem, I copied the files from the /wp-content/uploads to the ‘
   my-custom-folder’ directory and the old images were accessible. Nonetheless, 
   all new uploads correctly uploaded to the ‘my-custom-folder’ directory.
 *  Thread Starter [Michael Brütsch](https://wordpress.org/support/users/nailedit/)
 * (@nailedit)
 * [2 years, 2 months ago](https://wordpress.org/support/topic/plugin-breaks-custom-uploads-folder-2/#post-17516102)
 * Thanks for your reply. After some further investigation (after I couldn’t replicate
   it on 2 different dev environments) thankfully I found the problem with some 
   simple luck. I had the following line twice in my wp-config.php file (once in
   the end of the file where it belongs, and once directly before my `define('UPLOADS','
   my-custom-folder');` line):
 * `require_once(ABSPATH . 'wp-settings.php');`
 * For like over 7 years it never caused a problem, until now with the Kadence Blocks
   plugin. I don’t care how and why, but yeah, problem solved, thanks for your help!
   🙂

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

The topic ‘Plugin breaks custom uploads folder’ is closed to new replies.

 * ![](https://ps.w.org/kadence-blocks/assets/icon-256x256.png?rev=3178382)
 * [Kadence Blocks — Page Builder Toolkit for Gutenberg Editor](https://wordpress.org/plugins/kadence-blocks/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/kadence-blocks/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/kadence-blocks/)
 * [Active Topics](https://wordpress.org/support/plugin/kadence-blocks/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/kadence-blocks/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/kadence-blocks/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [Michael Brütsch](https://wordpress.org/support/users/nailedit/)
 * Last activity: [2 years, 2 months ago](https://wordpress.org/support/topic/plugin-breaks-custom-uploads-folder-2/#post-17516102)
 * Status: resolved