Blog

Change wordpress site url using mysql query

This tutorial is a very important part of moving WordPress site to one host to another host or localhost to live web hosting.
Here i am trying to elaborate the best basic method that is required to deploy WordPress site to live hosting.
So i can say there are some MySQL replace queries that will search the given string and then replace matched string to string that need to be changed .
Basically this MySQL query will use wp_option, wp_posts, wp_postmeta,wp_user and wp_usermeta.
So you can use this query in phpmyadmin sql console.

Please note : Please do not forget to change “http://www.siteoldurl” and ” http://sitenewurl” with correct url and please be careful about the “wp” prefix because sometime php developer or wordpress installation software use different prefix for mysql table.
So you can check MySQL table prefix from wp-config.php.
This can be found using this variable.
$table_prefix = ‘wp_’;

Leave a Reply

Your email address will not be published. Required fields are marked *

Security *