If WordPress is installed in a subfolder (not in the server root folder), it is easy to change its location
In our example, we’ll try replacing “https://site.com/aaa” with “https://site.com/bbb”
Login to the wp admin panel at “https://site.com/aaa/wp-admin”. Open Settings – General page. On this page, update 2 fields:
- “WordPress Address (URL)”, and
- “Site Address (URL)”.
Replace “https://site.com/aaa” with “https://site.com/bbb” and click Save Changes. The response you’ll get is going to be “This is somewhat embarrassing, isn’t it?” Ignore the message and don’t click anywhere (or better – close the browser).
Switch to SSH/WinSCP and rename the folder on the server (“aaa” to “bbb”). Open admin panel at the new address (“https://site.com/bbb/wp-admin”). Make sure there are no other parameters added to the address. Most likely, will need to re-login – but it should work from now on.
If “.html on PAGES” plugin is used, disable and enable it again! Open new web site to test.
Remember to update any incoming links on other sites, if there were any.
Alternatively, the same update could be done directly on the database
UPDATE zzz_options SET option_value='https://site.com/aaa' WHERE option_name IN ('siteurl', 'home');
- To confirm:
SELECT * FROM zzz_options WHERE option_name IN ('siteurl', 'home');
- Rename the folder using SSH/WinSCP
- Make sure all the previous steps are done immediately, as quickly as possible
- If “.html on PAGES” plugin is used, disable and enable it again!
- Open new web site to test
Tested on WordPress 5.5
1,348 total views, 2 views today