Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

When ever you click on an image in my site it displays www.sitename.com/wp-content/uploads/date/image.jpg. How do I change this to something like www.sitename.com/image.jpg or www.sitename.com/post/image.jpg?

share|improve this question

2 Answers 2

Wordpress, by defalt, WILL allow you to do this. Open your wp-config.php file and add the following line:

define( 'UPLOADS', '/media/' );

Change /media/ to whatever directory you want to use.

A word of caution: If you already have media uploaded, the path to that media is stored in the database. Changing the path will not update the stored paths, and you may break links to your existing media. You will need to write a query to update all the paths in the database. There may be a plugin to help you do this.

You can do this with other WP directories as well. See documentation here: http://codex.wordpress.org/Editing_wp-config.php#Moving_wp-content_folder

share|improve this answer

Wordpress by default will not allow you to do that. If you wish to change the url of uploads folder, you will have to use an additional plugin. This plugin will give you the following option so that you can modify your upload path:

enter image description here

Here's another plugin (haven't tested this one personally) that will let you do the same thing.

share|improve this answer
    
Wish there was something like that for free. –  Richard.S Apr 9 at 4:24
    
Checkout the second link in my answer, that might do the job for you. It's free –  vDog Apr 9 at 4:28

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.