Changes between Version 1 and Version 2 of how-to/wordpress/change-site-url


Ignore:
Timestamp:
May 22, 2018, 1:05:12 PM (15 months ago)
Author:
JaimeV
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • how-to/wordpress/change-site-url

    v1 v2  
    1 The official wordpress documentation recommends several valid methods of changing your site url.
     1= Changing the wordpress site url =
    22
    3 https://codex.wordpress.org/Changing_The_Site_URL
     3== Using the wp admin interface ==
    44
    55If you still have access to the wordpress admin interface for your site under the  "Settings->General" screen changing the values of the two fields named "WordPress Address (URL)" and "Site Address (URL)" is the easiest way to do this.
    66
    7 However if you do not have access to the admin interface or want to be sure that this value is changed everywhere in your site we recommend using the [ https://github.com/wp-cli/wp-cli ] utility which we've installed on all of our standard servers for you. You will need to access the command line [ https://support.mayfirst.org/wiki/faq/security/secure-shell | via ssh ] to use this tool.
     7== Using the wp-cli utility  ==
    88
    9 Once you have access to the server you can navigate using the change directory command {{{cd}}} to your web folder or the folder that contains your wordpress installation before invoing the wp-cli utility with the command {{{wp}}.
     9However if you do not have access to the admin interface or want to be sure that this value is changed everywhere in your site we recommend using the [https://github.com/wp-cli/wp-cli wp-cli] utility which we've installed on all of our standard servers for you. You will need to access the command line [https://support.mayfirst.org/wiki/faq/security/secure-shell  via ssh] to use this tool.
     10
     11Once you have access to the server you can navigate using the change directory command {{{cd}}} to your web folder or the folder that contains your wordpress installation before invoking the wp-cli utility with the command {{{wp}}}.
     12
     13{{{
     14siteuser@server:~$ cd sitedomain.org/web
     15}}}
    1016
    1117wp-cli can both check and directly set the siteurl configuration value from the command line.
    1218
    1319{{{
    14 0 siteuser@server:~/sitename.org/web$ wp option get siteurl
     20siteuser@server:~/sitedomain.org/web$ wp option get siteurl
    1521
    16 http://sitename.org
     22http://sitedomain.org
    1723}}}
    1824
     
    2026
    2127{{{
    22 0 siteuser@server:~/sitename.org/web$ wp option set siteurl https://sitename.org
     28siteuser@server:~/sitedomain.org/web$ wp option set siteurl https://sitedomain.org
    2329}}}
    2430
     
    2834This example uses the {{{--dry-run}}} argument to test without making any real changes. Remove the {{{--dry-run}}} argument and run again to make those changes effective.
    2935{{{
    30 0 siteuser@server:~/sitename.org/web$  wp search-replace --dry-run http://sitename.org https://sitename.org --skip-columns=guid
     36siteuser@server:~/sitedomain.org/web$  wp search-replace --dry-run http://sitedomain.org https://sitedomain.org --skip-columns=guid
    3137}}}
    3238
     
    3440
    3541{{{
    36 0 siteuser@server:~/sitename.org/web$  wp search-replace  --dry-run  http://www.sitename.org https://sitename.org --skip-columns=guid
     42siteuser@server:~/sitedomain.org/web$  wp search-replace  --dry-run  http://www.sitedomain.org https://sitedomain.org --skip-columns=guid
    3743}}}
    3844
    3945{{{
    40 0 siteuser@server:~/sitename.org/web$  wp search-replace  --dry-run  http://oldsitename.org https://sitename.org --skip-columns=guid
     46siteuser@server:~/sitedomain.org/web$  wp search-replace  --dry-run  http://oldsitedomain.org https://sitedomain.org --skip-columns=guid
    4147}}}
    4248
     49= Other methods =
     50
     51The official wordpress documentation also recommends several other valid methods of changing your site url.
     52
     53https://codex.wordpress.org/Changing_The_Site_URL