WordPress tip-Store Blog post Images in a different Folder or Subdomain
If you are using a self hosted WordPress platform it is recommended to Store your Blog post images in a different directory.This will ensure faster loading of your Blog pages.This tutorial explains how to achieve this.
Why should i need to Upload my Images in a Different Folder or Subdomain ?
1.Most browsers (Firefox,Chrome) create only a limited number of connections to one site at a time.So hosting your Blog post images will speed up your blog loading time.
2.Storing images in a different domain keeps the blog posts images organized.
To achieve this in WordPress 2.6+
1.Go to your Hosting panel and create a Subdomain for storing your blog post images.For example : img.yoursite.com
2.Open your WordPress dashboard and Click on Settings.Then click “Miscellaneous”.
3.Now change the default image upload folder which is wp-content/uploads.
![]()
Do not select the Checkbox “organize my uploads into month and year-based folders.
Configuring Windows Live Writer : If you post from Windows live writer you will have to configure the ftp settings.
1.Open WLW and go to Tools –> Accounts
2.Select your Blog and Click Edit.Then Select pictures
3.Now Select “Upload pictures in an FTP server” and click “Configure FTP settings”.
![]()
4.Select your image Folder that you Created and hit Ok.As simple as that.










Hey must say it’s a great tip. Hosting images in sub domain will reduce the concurrent connection and thus will make your wordpress blog fast. Kudos to this useful post.
@harsh : Glad you found it useful. Yes if possible images should be stored in a separate subdomain for faster loading
How does WordPress know what credentials to use when accessing this subdomain? There’s no where to enter ftp information in regards to uploading your files to another location such as this.
That would be very useful information. :) Just entering the url doesn’t seem like the end of the instructions.
@ mwaterous : I am sorry but i am unable to understand your question.Could you please clarify a bit ? Thanks
Don’t mind me, it’s late and I wasn’t thinking clearly. It dawned on me that this is for uploading them to a subdomain and not a completely different domain, and thus the path was an absolute and not off of a remote ftp.
@ mwaterous: Yes you are right now. this tutorial explains how you can store the images and other media on a folder in your domain only. Not on a different domain as you asked.Thanks for your interest here !
Hi Amit,
I need clarification about two points,
1.Can we do the same after we publishing some posts.Else should we do the same during the set up of the blog itself?
2.Second while configuring in WLW do you get any message after modifing the image storing location?
@George : First of all thanks for stopping by.Here are the answers :
1.You can modify the path for storing images at any time.By default the images are stored under wp-content/uploads. So if after some months you decide to change the upload location to suppose img[dot]yourdomain[dot]com it wont lead into problems.As after you make the change all your images will be stored there.However the previous posts will pull the images from wp-content/uploads only.In short,this process can be done at any time and not mandatory during setup.
2.No.Windows live writer can auto detect the image upload folder if you have the necessary permissions given.You can set the image folder in WLW from Blogs–>Edit blog settings.
hope that helps
hi amit, tq for this tip. i already apply for my blog. but when i try to upload img when writing new post, an error comes out:
” Unable to create directory /public_html/img/2009/10. Is its parent directory writable by the server? ”
i already set the file permission on img folder to 777 and all their sub-directories. also try to create folder name 2009 and 10. but the problem is same.
how can i fix this?
and does this tip will improve my blog loading speed? because my blog full of picture and time by time, the loading speed is decrease. any ideas how to speed up? i already use wordpress super-cache. but it was same.
tq for your future answer. :)
have a nice day from malaysian blogger..
Yes this tip will increase the loading speed as a browser can process requests from different domains at the same time.That means if you Call the images,CC and Js files and media from a separate domain then the caching will be much faster as the browser can download the required files from different domains parallely.Call everything from a single domain and everything is queued after a certain number of requests.
Regarding the WLW config : Baloot,everything seems to be normal.I have used WLW –>Edit blog settings–>configure FTP to set the image upload folder.But before doing that do the same in your WP-dashboard or there might be a conflict.
Hope that helps
wow, great tips… thanks for share…
Hello Amit, I tried doing what you said but I got this error:
Unable to create directory /public_html/img. Is its parent directory writable by the server? What do I need to change?
I am not sure what windows live writer is – I download the pictures to a folder on my computer and then upload it to wordpress.
Your help is much appreciated. Thanks
malini
@Malini: Open your FTP account using FTP software (e.g Fielezilla). Right click on the image directory and set the permission level to 777. That would make the directory writable and you can store the mages of your posts in your chosen directry
This is quite useful and should be used on slow servers. Increases the blog’s speed.
@NPXP: Yes, I have always hosted images on a subdomain because of speed and easier management. Thanks for the comment
Hello,
Is it possible that image upload folder to be located at another ftp server??
@Kote: Yes, its possible to define a separate FTP server for the image upload folder.
@Amit
Please tell me how ?
Hey Amit, I am getting the error “Unable to create directory /public_html/media. Is its parent directory writable by the server?”
In this case what do i have to do? I have used the folder “/public_html/media” for storing uploads and given the full url as “http://media.aspiredtechie.com”. Still it does not work.
@Sagar: Here is what you need to do:
1. Open your FTP server from Filezilla or other FTP software
2. Right click the media directory where you want to store the uploads and set the permissions to “777″. (Read write and execute permisssions).
3. You are done. Go back to wordpress and change that image upload folder.
Thanks for the comment and do let us know whether the problem was solved or not.
@Amit
Hey, can’t you help me to define a separate ftp server for image folder?
@Kote: Sorry for not replying. I am testing the options to define a separate FTP server for the image upload folder. I will post the answer in a day or two. Thanks for your patience.
@Amit
Thank you, I’m waiting :)
@Kote: It looks like you can not change the root domain and host images on a separate domain.
Suppose your site is hosted at xyz.com. You can not host the images at abc.com but can surely use a subdomain on xyz.com to host the images. This is because WordPress can not identify any other domain to store the media files which is different from the domain where you installed WordPress.
@Amit
Okey :(
thanks
@Amit – Done! Its working now without any permission problems.
@Sagar: Glad it helped. Thanks for the comment.
Hi
I have a strange situation and searching net lead me to your blog.
My hosting space for my photography site is exhausting and at the moment i am not a position to pay more to increase web space.
And its obvious , i cannot upload images to separate domain.
But i can upload images seperately from FTP on other server
and insert the links in my posts …
Noone sees the picture path , so it will work somehow ..
what you say ?
@waqas: Yes, it will work as long as you have control over the hosting space where the images are stored
Hi
I’ve hosted the images of my site in the subdomain. But google is not crawling those images. Please Help me ..
@Sagar: Check your robots.txt file to see whether your subdomain is blocked or not. You can use the site operator in Google Images to check whether your site’s images are indexed or not. Thanks for the comment.
when checking crawler access of img.mydomain.com in webmaster tools, it shows the message “Not in domain”. I’ve also used site operator to see whether the images are indexing. But no images are showing there. Also the images are not appearing in the cached pages by Google. Please describe in details. Thank you for your quick response.
@Sagar: How old is your site ?
About 5 months. But I recently transferred the images in the subdomain.
@Sagar: Give Google Bot some more time to find the new location of your images.
Great idea but when I go to Settings there is no Miscellaneous… I’m self hosting WP
@Mark: Is your a/c an administrator account ?