IAMEM Hosting

WordPress: Change URL in Media and Posts

Home > Blog > CMS > WordPress: Change URL in Media and Posts
02Mar, 2016
0

WordPress: Change URL in Media and Posts

 

After changing the wordpress to the new website, it is observed that the URL of media files and Internal post links still shows the OLD url.

To change it, login to MySQL server and select the wordpress database and run the below query.

 

UPDATE wp_posts SET post_content = REPLACE(post_content, 'http://www.oldurl.com/', 'http://www.newurl.com/');

 

Note:

Make sure that the you are on the correct wordpress database

For security reasons if you have changed the database prefix to something else other than the default “wp_” make sure to replace the same in the above query.

 

Leave a Reply

four × five =

Copyright © 2019 | iamemhost.com . All rights reserved.