Tip 002 – Fixing URLs after migrating your wordpress blog

There are many situations when you need to migrate your blog data from one server to another, sometime from one domain to another domain. In such cases you will often need to fix the urls of the attachments which are included in the post, and other static links referring to old domains.

To fix such URLs easily, install the Velvet Blues Update URLs plugin from the default wordpress repository. Once installed, go to Settings->Update URLs link from your wordpress admin panel and update the URLs as shown in the screenshot below

Velvet Blues Update URLs Plugin

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