Have you accidentally changed WordPress URL in the General Settings area? This means you can’t to access your website frontend and backend. Don’t worry! This tutorial will show you how to fix this. Yet, firstly, let’s talk a little about WordPress sites’ addresses and why they are so important.
What Is WordPress Address and When You Can Change It
Among all the settings of WordPress, the most important are two. They are “WordPress Address” and “Website Address”. Both are located in the “Settings” – “General” section. “WordPress Address” is directly your domain, and “Site Address” is the place where WordPress is installed. It can be a subdirectory of / blog / of the main domain or whatever you like.
These settings are responsible for how your website URL will look. They are usually adjusted at the installation stage. Plus, most often, there is no need to change them. That’s why accidentally changed WordPress URL is rather a problem. A solution to it you’ll get below. But sometimes it happens that sites’ owners decide to transfer their websites to a new domain. Or, they need to place sites in a subdomain or subdirectory.
Please, pay attention that that changing a site’s address yourself is not safe. If need to a new domain, for example, better ask for the help of professionals.
Steps to Fix Accidentally Changed WordPress URL
Login to your Hosting Control Panel (Cpanel). Open the PHP MY Admin Tool and select your database on the left. Database name can be found in the main configuration file of WordPress – wp-config.php, this file is located in site root folder.
Go to the Database, click on Search (enter the string of the text, which you have used under General -> Settings). Make sure you have selected Search for All of the tables and click on the Go button. You’ll see this link set in the wp_options table.
Go ahead and modify the site_url option value. To do that hit the Edit button (little pencil icon) and simply correct site URL inside the options_value box. Click on the Go button after completing the edits. If everything works fine you will see a pop up message saying ‘1 row was affected’ and how long it took.
Type the original site_url/wp-admin in your browser address bar and hit the Enter button. You will see the default WordPress login page, where you should enter your username and password. Site is back to normal now.
So, the situations that can cause accidentally changed WordPress URL are under your control now! Let your WordPress website always work correctly!