Have you ever wondered, how to change your wordpress site name url? Or how to change a wordpress site name? I know these questions are probably keeping you up at night! J.K
If you want to change your site name or URL in WordPress, you can go to the Settings -> General and change it there, or you can edit the wp-config.php file on the server and add the following lines:
Your WordPress address and site address (or URL) are very important as they reference both the address of your site on the web and the location of your site’s files and admin screens.
There are many reasons why you might need or want to change your WordPress URL. Perhaps you’re changing domains, moving to a subdomain, updating from www to non-www, moving files around, or even migrating from HTTP to HTTPS.
Whatever the case may be, there are a few options you have when it comes to changing the URL, some more advanced than others.
In this guide, we’ll show you the different methods you can use to change the URL of your WordPress installation and your WordPress site URL, which are two different things.
Change WordPress URL via the Admin Dashboard #
The first and most common method is to change your WordPress URL directly from within the admin dashboard. In the admin menu, go to Settings > General to access the general settings screen. You can then update the following:
- WordPress Address (URL): The address to reach your site.
- Site Address (URL): The address of your WordPress core files.
Both should match unless you are giving WordPress its own directory. Remember that after you click Save Changes, your WordPress dashboard is now only accessible via the new URL. So be sure to check that you’ve entered the right URL.
If you do accidentally enter the wrong URL, you can override the settings in the admin screens by editing your wp-config.php file (was see the next method below).
Note: If the fields above are grayed out, it is most likely because you already have hard-coded values in your wp-config.php file. In which case, jump to the next method.
If you’re creating a fresh WordPress installation on Kinsta hosting, you will be given a temporary URL, such as sitename.kinsta.cloud. You can use the directions above to update the address.
You might also need to clear your WordPress cache after updating the URLs, otherwise you might receive a redirect error. If you’re a Kinsta client, you can clear your cache from the MyKinsta dashboard under the Tools section for your site.
Change WordPress URL in wp-config.php File #
The second most common way to change your WordPress URL is in your wp-config.php file. It is important to note that values in wp-config.php override the settings in your WordPress admin screens.
If the fields aren’t editable (as seen below), it is most likely because they are hard-coded in this file.
The wp-config.php file is typically located in the root directory of your WordPress site and can be accessed via FTP, SSH, or WP-CLI.
In your wp-config.php file, add these two lines somewhere above the line that tells you to stop editing:
define( 'WP_HOME', 'http://yoursiteurl.com' );
define( 'WP_SITEURL', 'http://yoursiteurl.com' );
Save your wp-config.php file and close it.
When you go to the General settings screen in your WordPress admin, you’ll see that those two fields are now grayed out. You can’t edit them unless you remove those two lines from wp-config.php.
If you want access to those settings in your dashboard again, all you need to do is remove them from your wp-config.php file.
Change WordPress URL Directly in Database #
A third method you can use to change your WordPress URL is directly in the WordPress database. To do this, you use phpMyAdmin.
Important #
Editing and manipulating database tables directly from phpMyAdmin could break your site if not done correctly. If you are not comfortable doing this, please check with a developer first. And make sure your site is backed up before you edit your database.
WordPress Hosting Now or WPHN is a free WordPress Hoster with no cost for hosting. Unlimited storage, dedicated 1G speed to the internet, nightly backups with UpDraftPlus, support to change DNS settings, and development help. Plus, we will throw in a free email address! Can’t beat this deal. To read more and sign up, visit our About and Registration Page
No Responses