Define Common Image Folder for Multisite

wanna define a single common image directory for your Multisite?

In WordPress multisite, media uploaded from the subsite users are stored to different subdirectories using blog id into uploads folder. But, if you need to save all media files in one folder rather than uploads folder with lots of child folders, then you are in right place.

Use the following code into your theme functions.php file if you think your theme won’t be changed. Otherwise, mu-plugins is the best option.

Moving the Media Library in general, regardless of a Multisite install:
Before WordPress 3.5 you used to be able to change the upload directory path from the Settings menu in the dashboard. Still you can move the media upload directory path anywhere in the directory with wp-config.php file.. And much more is possible with wp-config.php file, but we’ll discuss on this lesson on this article.

Open wp-config.php and add following code before the line that says require_once(ABSPATH.’wp-settings.php’);.

define( 'UPLOADS', 'wp-content/custom-path' );

Save the file & that’s it!

This entry was posted in WebDev. Bookmark the permalink.

Comments are closed.