Difference between revisions of "Change wordpress site URL"

From Notes_Wiki
(Created page with "<yambe:breadcrumb>Wordpress_configuration|Wordpress configuration</yambe:breadcrumb> =Change wordpress site URL= In a working wordpress site /wp-admin can help in changing si...")
 
m
 
Line 1: Line 1:
<yambe:breadcrumb>Wordpress_configuration|Wordpress configuration</yambe:breadcrumb>
[[Main Page|Home]] > [[CentOS]] > [[CentOS 6.x]] > [[Web based tools or applications]] > [[Wordpress configuration]] > [[Change wordpress site URL]]
=Change wordpress site URL=


In a working wordpress site /wp-admin can help in changing site URL.  However if a wordpress site is no longer functioning because site URL has changed then use following steps to change wordpress site URL use:
In a working wordpress site /wp-admin can help in changing site URL.  However if a wordpress site is no longer functioning because site URL has changed then use following steps to change wordpress site URL use:
Line 16: Line 15:


Refer https://codex.wordpress.org/Changing_The_Site_URL
Refer https://codex.wordpress.org/Changing_The_Site_URL
[[Main Page|Home]] > [[CentOS]] > [[CentOS 6.x]] > [[Web based tools or applications]] > [[Wordpress configuration]] > [[Change wordpress site URL]]

Latest revision as of 14:43, 28 July 2022

Home > CentOS > CentOS 6.x > Web based tools or applications > Wordpress configuration > Change wordpress site URL

In a working wordpress site /wp-admin can help in changing site URL. However if a wordpress site is no longer functioning because site URL has changed then use following steps to change wordpress site URL use:

  1. Edit wp-config.php and append
    define('WP_HOME','http://example.com');
    define('WP_SITEURL','http://example.com');
    Note that this is not ideal as this fixes the site URL and later this cannot be changed via settings page. Updating wp_options database table option_name siteurl and home is better.
  2. Search for old URL everywhere using 'grep -r old-url *' and replace using
    find . -type f -exec sed -i "s/old-url/new-url/g" '{}' \;
    in all sub-folders and files recursively.

Refer https://codex.wordpress.org/Changing_The_Site_URL


Home > CentOS > CentOS 6.x > Web based tools or applications > Wordpress configuration > Change wordpress site URL