You need to make the following changes into wp-config.php file.
We can use PHP dirname to get a parent directory’s path.
This will return the directory of current included file:
dirname(__FILE__);
How to move wp-content folder?
wp-content directory holds themes, plugins, and uploads
Use this code to WP_CONTENT_DIR to the full local path of wp-content directory (without the trailing slash):
define( 'WP_CONTENT_DIR', dirname(__FILE__) . '/blog/wp-content' );
Use this code to WP_CONTENT_DIR to the full URL of wp-content directory (without the trailing slash):
define( 'WP_CONTENT_URL', 'https://yogeshchauhan.com/blog/wp-content' );
How to move the plugins folder?
Use this code to WP_PLUGIN_DIR to the full local path of plugins directory (without the trailing slash):
define( 'WP_PLUGIN_DIR', dirname(__FILE__) . '/blog/wp-content/plugins' );
Use this code in case you have compatibility issues:
define( 'PLUGINDIR', dirname(__FILE__) . '/blog/wp-content/plugins' );
Use this code to WP_PLUGIN_DIR to the full URI of plugins directory (without the trailing slash):
define( 'WP_PLUGIN_URL', 'http://yogeshchauhan.com/blog/wp-content/plugins' );
How to move the themes folder?
You won’t be able to move the themes folder since themes directory path is hardcoded relative to the wp-content folder:
$theme_root = WP_CONTENT_DIR . '/themes';
You have an option to register additional theme directories via register_theme_directory WordPress function.
How to move the uploads folder?
Use this code to move the uploads folder:
define( 'UPLOADS', 'blog/wp-content/uploads' );
No need to add a leading slash in the uploads path address since it is always relative to ABSPATH.
Uploads folder path can not be absolute.
directories folder functions plugin theme uploads wp-content