Occasionally you will get a user who is interested in changing their site URL. This is a harmless request, but unfortunately many users break their site trying to change their domain within their WordPress dashboard.
If you log into any WordPress dashboard and go to Settings > General, there’s a section where you can change your WordPress Address (URL) and Site Address (URL). This give folks the idea that they can change their domain right here, but this is very misleading and will break the site. If we could remove this section of the WordPress settings we absolutely would, but there’s no way around it.
Let’s say a student or faculty member tries to change their domain name from wpdemo.labrumfield.com to test.labrumfield.com:
The user edits their fields to their desired URL, scrolls down, and clicks Save.
They would then be met immediately with the following error:
If they were to attempt to log in again, they would be greeted with a WordPress dashboard that looks like this:
There’s no way to reverse the mistake in WordPress. At this point, we need to log into the user’s database and correct the site URL there.
To do this, go to the user’s cPanel, search php in the top search bar, and then click phpMyAdmin.
Click the database for the WordPress instance in question (see note below), and then click wp_options from the drop-down on the lefthand side. The first line should read siteurl and show the recently changed site URL. Click edit.
To find the correct Wordpress database go to cPanel > Applications > My Apps and you will see the database information in the Advanced Tab.
On the following page, replace the current URL with the original URL and click Go.
Now go to page 2 in wp_options. Click edit next to the home line.
Just like before, edit the URL back to the original one, scroll down, and click Go.
Now when you refresh the dashboard, all should be back to normal.