Editing the default image/file upload location of WordPress!

wordpress-logo-2.jpg By default WordPress uploads all the images/files to wp-content/uploads folder and I never bothered to check that this can be changed or not, as I was happily posting through Windows Live Writer, while I was using Windows XP.

Now that I shifted to Mac OS X, I started using Ecto and I started hating it big time, just for the reason that it doesn’t have the FTP upload feature and because I keep all my images in the http://www.reviewsaurus.com/images/ folder, I was getting frustrated as there was no simple way of inserting the images because if I wanted to include images in the post then I would have done these steps :

1. Take the screenshot using Skitch & save it.
2. Upload the image using CyberDuck (ftp program).
3. Insert the image using the URL.

Well, it’s not simple trust me it’s not, when you have to write 2-3 posts a day then you would not love to perform these steps when you never had to do it before.

So, I started my research and found out that we can easily change the image/file upload location of WordPress and then everything got simple!

Here’s how we can change the image/file upload location of WordPress :

1. Create a new file called path.php and paste the following code in it :

<?php
$p = getcwd();
echo $p;
?>

2. Upload it in the folder of your webserver (remember to use the folder where you want the images/files to be uploaded).
3. Open the file in webbrowser for e.g. http://www.example.com/images/path.php
4. Copy the path : this path is the absolute path of the images folder.
5. On WordPress Admin panel; go to Options->Misc
6. Paste the copied path in the text box and save the changes.

From now on whenever you’ll use WordPress admin or if you’ll use any blogging client then it will upload the images in the desired directory and not wp-content/uploads

Related posts:

  1. Use FTP upload in BlogJet while using WordPress!
  2. Paint.NET – Simple Image Editing gets advanced!
  3. WordPress Tip : Extending extended RSS (WXR) 2 Mb limit!
  4. Have more widgets below the content without cluttering the WordPress post!
  5. First Free Set Of WordPress Minimalist Themes From DesignSaurus!
This entry was posted in Tips n Tricks. Bookmark the permalink.

12 Responses to Editing the default image/file upload location of WordPress!

  1. Keith Dsouza says:

    Nice tip buddy quite useful when moving from one Blogging Client to another too ;) Stumbled

  2. ReviewSaurus says:

    @ Keith : Thanks for stumble and indeed now I don’t find problem in using any blog editor provided it’s got the basic features right :)

  3. Binny V A says:

    Did you try to create a link to /images/ folder in /wp-contents/uploads ? That is /wp-contents/uploads/ should point to /images/

    My first guess is it will work.

  4. ReviewSaurus says:

    @ Binny : Well, I’ve never tried that and I even don’t know how to even do it. Can you tell us that how that can be done ?

  5. Binny V A says:

    If you have ssh access, go to the folder where your site is located in a terminal and run this command…
    ln -s wp-contents/uploads images

    I am assuming that you are using a linux server.

  6. ReviewSaurus says:

    @ Binny : Yes I’m on linux server..however I’m currently fine with the solution I found :)
    Why don’t you write a post on this ? I’m sure there will b emore people who’d love to change the image/file location

  7. CAR57 says:

    I’m totally new to WP, just went through QuickStart PHP for 2 weeks–I too want to change the folder to the images folder for my custom theme, but the instructions above for making a path.php file above and putting it in the theme’s images folder did not work–get 404 error no matter what url I put in my my browser (I have a local install of WP on my Mac, using MAMP to administer it). Can someone give the dummy explanation of the above instructions?

  8. tom stone says:

    Am I missing the point here but why dont you just go to settings > misc > store uploads in the folder

    You can just change it there with out using any code.

  9. yasz says:

    Just what I was looking for. A good one man :)

  10. Guest says:

    why do it the complicated way when you can just goto Settings -> Media and change the upload directory there

  11. techcruserankit says:

    Thanks ,, i was looking for it..

  12. I also want to change my theme folder of images, but these instructions to create a file path.php above, and placed in a folder Theme with its images do not work – get a 404 error, also

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>