Viewing 10 replies - 16 through 25 (of 25 total)
  • @timsilva_ Thanks for the replay..

    I tried with above but no use..

    But I’m trying with adding the following snippet
    define( 'UPLOADS', 'customfolder' ); in wp-settings.php file. (Not in wp-config.php file)

    My problem was resolved and I do not find out any errors in my website.

    I don’t know about adding snippet in wp-settings.php file is correct or wrong. So please any one let me know I’m mistaken or not..

    Please..

    Thread Starter timsilva_

    (@timsilva_)

    Try removing that line from wp-settings.php and placing it into wp-config.php instead. That is probably the issue. Maybe it worked before like my code did, but it no longer works now. The way I was doing it, and the way you are doing it are both wrong, but it managed to work okay before 4.5.

    Good luck!

    Yeah! Finally I solved my problem! Thanks!! I couldn’t believe it was just change the line position!

    thank you timsilva_ for question and Tech Dud Samuel Wood (Otto) for pointing out solution, not only https://www.hongkiat.com/blog/wordpress-custom-upload-dir/ have wrong recomendation, almost everyone have that, even this guru https://premium.wpmudev.org/blog/change-default-wordpress-uploads-folder/ plus lots of other out there have the same wrong recommendation! let say it might have been working before not with 4.5 anymore.
    Let them update there recommendation…
    So for those who have trouble and not yet figure out, solution is to define the your custom folder with other define…
    I have add define(‘UPLOADS’, ‘wp-content/myimages’); before database details
    ontop of /** MySQL database username */ line and it works.

    I place the code define( 'UPLOADS', 'customfolder' ); before the line require_once(ABSPATH . 'wp-settings.php'); Its working good and wordPress loads files from custom uploads directory and the problem was resolved but, I have a another errors Error 500 – Internal Server Error and HTTP Error when uploading images to media library.

    Also Im trying with vgmediax solution but no use.

    Does anyone have a similar problem?

    overthemoonwp

    (@overthemoonwp)

    Thank you so much for this solution, I had the same issue.

    I set my image uploads directory in wp-config.php using code:
    define('UPLOADS','images');
    All worked fine until today when I updated to WP version 4.6.1 – after the update none of my images were showing. When I checked in the media library the file path to every image was now /wp-content/uploads/ instead of /images/ !!!

    I moved the code near to the top of the document in wp-config.php as suggested and all works fine, TY!

    Question if I want to define uploads to go into /wordpress/wp-contents/uploads.
    How do I write that directive?

    to fix this:
    just move define( ‘UPLOADS’, ”.’YourFolder’ );
    above require_once(ABSPATH . ‘wp-settings.php’);

    what a pain hours of my life has been wasted over this simple fix.

    if any of you name your custom upload directory images you are fired. You name the directory after your keyword in camel case with no spaces like this. YourMainKeywordCity . Dum dums

    The main reason you make a custom image directory is safety. Make sure you take off the date and month feature in settings. double clicking through month and days hurts your fingers. Having your images all in the same directory optimizes the bots and assists you with immediate access to your images in the root directory.

Viewing 10 replies - 16 through 25 (of 25 total)
  • The topic ‘Defining custom uploads directory is broken in WP 4.5 (wp-config)’ is closed to new replies.