Wordpress tip-Store Blog post Images in a different Folder or Subdomain

Written by Amit Banerjee on 7 Nov, 2008 Under Blogging

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.

Configure default image upload folder in wordpress

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”.

Configure WLW Ftp Settings

4.Select your image Folder that you Created and hit Ok.As simple as that.

Loading
  1. Reader Comments

  2. 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.

    August 18th, 2009
    • @harsh : Glad you found it useful. Yes if possible images should be stored in a separate subdomain for faster loading

      August 18th, 2009
  3. 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.

    September 27th, 2009
    • @ mwaterous : I am sorry but i am unable to understand your question.Could you please clarify a bit ? Thanks

      September 27th, 2009
  4. 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.

    September 27th, 2009
    • @ 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 !

      September 27th, 2009
  5. 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?

    October 5th, 2009
    • @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

      October 5th, 2009
  6. 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..

    October 6th, 2009
    • 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

      October 6th, 2009
  7. wow, great tips… thanks for share…

    November 16th, 2009
  8. 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

    January 3rd, 2010
    • @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

      January 10th, 2010

Add Your Comment

All Comments are Moderated.

YOUR COMMENT



Join Our Community

Submit Product For Review

Want a Software or a product to be reviewed ? Tell us about it, we will do the rest.