Help! I changed the domain and now I can’t log in via admin online

Here are two options for you:

1) Do you have access to the WordPress database via PhpMyAdmin or similar? If so, you can change the information via the wp_options table in siteurl and home (inside the option_name column). Change both those and you should be good to go.

WARNING! If you make the change in the database be VERY careful not to touch anything else or you might mess up your whole WP database. I’ve attached screenshots so you can see the correct table/row to edit.

A good rule of thumb is, if you don’t know what it is, don’t touch it. If you don’t feel confident doing this, try option 2.

Change siteurl option

Change home option

2) Do you have access to the hosting account or FTP? If so you can hard code the domain into WordPress in the wp-config.php file.

define( 'WP_SITEURL', 'http://yourdomain.com');
define( 'WP_HOME', 'http://yourdomain.com');

Save and/or upload the file and you should be able to log back into your system.

Important! This setting doesn’t actually change the database settings, so if you delete the two lines of code you added to wp-config.php, you’ll be back at square one. Only delete if you are able to eventually change the database (once you have defined WP_SITEURL and WP_HOME, you can no longer update those values in the database through WordPress)

Explaination from the WordPress codex:

“NOTE: It won’t change the Database value though, and the url will
revert to the old database value if this line is removed from
wp-config. Use the RELOCATE constant to change the siteurl value in
the database.”

You can learn more about customizing the wp-config.php file here on the WordPress codex page