Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

How to change the Site URL and Home URL on a WordPress Site

When do you need to change the Site Url and home URL in wordpress

1. When you move your site from your PC to online or simply when you move your project from one location to another.


Simply , Add the following lines in wp-config.php to update site URL and Home URL as

1. wp-config.php


2.Add the following lines in functions.php


3. Use the following sql query to update the site url and home url as

UPDATE wp_options SET option_value = replace(option_value, '', '') WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE wp_posts SET guid = replace(guid, '','');
UPDATE wp_posts SET post_content = replace(post_content, '', '');
UPDATE wp_postmeta SET meta_value = replace(meta_value, '', '');

This post first appeared on PHP Fresher, please read the originial post: here

Share the post

How to change the Site URL and Home URL on a WordPress Site


Subscribe to Php Fresher

Get updates delivered right to your inbox!

Thank you for your subscription