System Admin

Change WordPress Domain Name

If you ever decided to change your WordPress site’s domain, firing up following MySQL queries can reduce internal redirections.


  1. is old-domain
  2. is new-domain


UPDATE `wp_options` SET option_value = replace(option_value, '', '') WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE `wp_posts` SET post_content = replace(post_content,'','');
UPDATE `wp_postmeta` SET meta_value = replace(meta_value,'','');
UPDATE `wp_comments` SET comment_author_url = replace(comment_author_url,'','');
UPDATE `wp_comments` SET comment_content = replace(comment_content,'','');
UPDATE `wp_commentmeta` SET meta_value = replace(meta_value,'','');

Above will take care of, options table, posts & comments. If you have any other database table/column which need change you can run queries like below any number of times:

UPDATE `TABLE_NAME` SET meta_value = replace(COLUMN_NAME,'','');

Related Articles

Leave a Reply

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