Changes between Version 1 and Version 2 of how-to/wordpress/change-site-url
- Timestamp:
- May 22, 2018, 5:05:12 PM (6 years ago)
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 = 2 2 3 https://codex.wordpress.org/Changing_The_Site_URL 3 == Using the wp admin interface == 4 4 5 5 If 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. 6 6 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 == 8 8 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}}. 9 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 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 11 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 invoking the wp-cli utility with the command {{{wp}}}. 12 13 {{{ 14 siteuser@server:~$ cd sitedomain.org/web 15 }}} 10 16 11 17 wp-cli can both check and directly set the siteurl configuration value from the command line. 12 18 13 19 {{{ 14 0 siteuser@server:~/sitename.org/web$ wp option get siteurl20 siteuser@server:~/sitedomain.org/web$ wp option get siteurl 15 21 16 http://site name.org22 http://sitedomain.org 17 23 }}} 18 24 … … 20 26 21 27 {{{ 22 0 siteuser@server:~/sitename.org/web$ wp option set siteurl https://sitename.org28 siteuser@server:~/sitedomain.org/web$ wp option set siteurl https://sitedomain.org 23 29 }}} 24 30 … … 28 34 This 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. 29 35 {{{ 30 0 siteuser@server:~/sitename.org/web$ wp search-replace --dry-run http://sitename.org https://sitename.org --skip-columns=guid36 siteuser@server:~/sitedomain.org/web$ wp search-replace --dry-run http://sitedomain.org https://sitedomain.org --skip-columns=guid 31 37 }}} 32 38 … … 34 40 35 41 {{{ 36 0 siteuser@server:~/sitename.org/web$ wp search-replace --dry-run http://www.sitename.org https://sitename.org --skip-columns=guid42 siteuser@server:~/sitedomain.org/web$ wp search-replace --dry-run http://www.sitedomain.org https://sitedomain.org --skip-columns=guid 37 43 }}} 38 44 39 45 {{{ 40 0 siteuser@server:~/sitename.org/web$ wp search-replace --dry-run http://oldsitename.org https://sitename.org --skip-columns=guid46 siteuser@server:~/sitedomain.org/web$ wp search-replace --dry-run http://oldsitedomain.org https://sitedomain.org --skip-columns=guid 41 47 }}} 42 48 49 = Other methods = 50 51 The official wordpress documentation also recommends several other valid methods of changing your site url. 52 53 https://codex.wordpress.org/Changing_The_Site_URL