Tip 001 – moving your media files to a different location

WordPress stores all the media files in the uploads directory inside wp-content/uploads directory. Sometime you may want to change it to a different path than the default one for better security or any other purpose. WordPress allows users to change the media directory from configuration file. For example, if you want to move your media files to a new folder named assets in the root directory, change the value of UPLOADS directive like this

Remember not to add any trailing or beginning slash

Sometime after moving media directory, your media files may suffer from 404 Error which are already linked with existing posts using their previous locations. To fix this problem, lets wait for our next post, Tip 002 – Fixing Media File Urls After Migration