Changing the URL that your WordPress install is living at isn’t a difficult process, however it’s easy to get tripped up in a few areas, especially because WordPress has a setting under Settings > General that makes you think simply changing the field here should work and instead it will break your website.
In this case the user wanted to get /blog off the end of the URL but by changing the address here the site stopped working entirely.
Fix in the Database
The fix here is done by editing the WordPress database. In cPanel go to Databases > phpMyAdmin
You should see a list of your databases on the left. Expand the WordPress database for your install (if you only have one site there will be just this one) and choose wp_options as the table to edit.
The wp_options table holds two fields that correspond to the fields you saw earlier in the WordPress settings, siteurl and home. Both will need to be changed back to what they were previously for the site to load at the old URL. siteurl should be on the first page and often home is on the second page. You can click Edit next to the field and update the URL to what it was previously and then click Go to save
After editing those two fields the site should come back online at the old URL. Now you can move the install to the new location. The easiest way to do this is to view our guide on cloning your install to a new address. If you want to buy a new domain first and add it to your account to move the install to that new domain our Addon Domains guide can assist you with that process.
Fix Via WP-CLI
You would need to be in the root directory of the WordPress site when running the following:
wp --allow-root search-replace 'OLD DOMAIN' 'NEW DOMAIN'
The above command would replace all instances of
OLD DOMAIN in the WordPress database with