Web Development

How To Change Media Upload Folder upto WordPress 3.5

In Wordpress 3.5, media upload folder's setting is missing so, if you installed then follow these steps to choose custom folder or sub-domain to host image in Wordpress 3.5, the newest version of Wordpress

WordPress has launched a new version, WordPress 3.5 for users.

The WordPress version comes with a lot of changes in it’s dashboard interface design, like you can see the buttons were earlier in capsule design but now in this version they are designed as round rectangle.

The major update in WordPress 3.5 is it’s Media Uploads. Inserting Media is easier, you just have to click on the media icon and select the media files of your computer by ticking the checkbox, same as the printer, when you print many images.

But, in this WordPress version, If you will try to change your media uploads folder then what?

Earlier, when you were needed to change media uploads folder, you just have to navigate to Settings >> Media and there are fields available to choose the media file location but now it is not available, See Below image.

Wordpress 3.5 Media Settings
WordPress 3.5 Media Settings

Now, if you want to change media uploads folder then you need to add just a small line of code to your wp-config.php file located at your website’s root directory. If you want upload directory to be wp-content/files then you need to add this code  in wp-config.php:

and if  you want to set a custom folder, say http://www.yourdomain.com/files/ then you need to add this code to your wp-config.php file:

However, WordPress didn’t remove the option of “organize my uploads into month-and-year” based folder so, you can still choose whether you want your WordPress media folder to be arranged by month-and-year or not.

To Host Media Uploads from Sub-Domain

Hosting files from sub-domain is always a wise choice as the images, videos load parallel on visitors’ browser and improve your website’s loading time drastically.

So if you are thinking to set up a sub-domain to host all your media uploads and you didn’t upgrad you WordPress version to 3.5 then you are quite lucky.

You just have to follow these simple steps:

Media Uploads Settings for WordPress 3.4.2
Media Uploads Settings for WordPress 3.4.2

Step 1: After logging-in to WordPress Admin Panel, Go to Settings >> Media.

In “Uploading Files” there are two fields, “Store uploads in this folder” and “Full URL path to files”

Step 2: In “Store uploads in this folder” put your folder’s name located at your website’s root. Like, if you made sub-domain cdn.yourdomain.com then you will find “cdn” folder at public_html, the website‘s root folder. So, put cdn at that field.

Step 3: In “Full URL path to files” , put your sub-domains full URL address along with http://. So you need to put http://cdn.yourdomain.com at the second field.

Now, even if you upgrade your WordPress to 3.5 then the media will still be hosted from your sub-domain. But, if you have upgraded to WordPress 3.5 like that of mine, then you have to downgrade to the previous version of WordPress.

Tags

About the author

Saurabh Saha

Saurabh Saha is techno geek and the owner of Pharmaceutical-grade-fish-oil.biz. He loves to learn new tricks and share them with his readers. Saurabh is currently pursuing MCA from University of Delhi.

8 Comments

Click here to post a comment