: Images on my site contain wp-content/uploads/ in the URL, how do I change this? When ever you click on an image in my site it displays www.sitename.com/wp-content/uploads/date/image.jpg. How do
When ever you click on an image in my site it displays sitename.com/wp-content/uploads/date/image.jpg. How do I change this to something like sitename.com/image.jpg or sitename.com/post/image.jpg?
More posts by @Margaret670
2 Comments
Sorted by latest first Latest Oldest Best
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: codex.wordpress.org/Editing_wp-config.php#Moving_wp-content_folder
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:
Here's another plugin (haven't tested this one personally) that will let you do the same thing.
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.