Proper way to change the path of uploads folder for existing WordPress site

Until now I have used default WordPress directory structure, however since I started using GIT, I plan to setup WordPress as a submodule and also change the paths of upload folder.

Since the path for existing images is already set in the database, is there a way to change them automatically?

Related posts

Leave a Reply

1 comment

  1. if you need to change default media upload location,you need to edit the wp-config.php file located in the root directory of your WordPress installation. If you want upload directory to be wp-content/files then you will need to place the following code in wp-config.php

    define( 'UPLOADS', 'wp-content/'.'files' ); 
    

    If you want the upload directory to be outside wp-content, like http://www.example.com/files/ then you need to set upload path in wp-config.php like this:

    define( 'UPLOADS', ''.'files' ); 
    

    For exstining images:-

    Copy all the exstining images of uploads folder to new folder which has set in the wp-config.php file.

    The above information is only to Change the Default Media Upload Location.