Posted on

Change WordPress URL in 3 simple techniques

Are you looking for a simple method to change WordPress URL? Fortunately, we’ll talk about several helpful techniques in today’s blog post to change WordPress URL simply for you. Let’s now analyze them.

The benefits when you change WordPress URL?

You may occasionally need to change your WordPress URLs in the following circumstances:

First and foremost, you want to entirely switch to a new domain name. Because you are aware that the domain name you are now using is not appropriate.

In this situation, you must modify the URLs of your websites and transfer them all to the new domain.

Second, you wish to switch your website from HTTP to HTTPS in order to increase its security or perhaps it’s ranking.

Thirdly, you must modify your website’s URL if you want to migrate WordPress to a different directory. You could wish to eliminate the /WordPress/ part of your WordPress URL, for instance.

What do we do to change WordPress URL?

Method 1: Change the WordPress URL from your WordPress dashboard

The simplest approach to change WordPress URL from the admin panel is in this fashion. You may now keep track of the actions you need to take.

First, from your WordPress dashboard, navigate to Settings > General.

Then, on the screen for general settings, you must alter the following two fields:

WordPress Address (URL): You must input the address to access your WordPress website (URL).

Site Address (URL): Enter the URL of your WordPress core files as your site’s address.

Change WordPress URL 1

If you don’t want your site’s home page and WordPress installation directory to be different, you should note that both fields’ URLs are the same.

Let’s click the “Save Changes” button at the bottom of the page when you are finished.

You may still change the settings in the admin panel if you input the incorrect URL or a mismatched URL by editing your wp-config.php file. In the following technique, we will demonstrate this.

It is vital for you to delete your WordPress cache after changing the new URLs. Or else, you may experience a redirect problem. You might want to refer to our comprehensive instructions on how to manually clear your WordPress cache.

Method 2: Change WordPress URL via wp-config.php File

Utilizing the wp-config.php file is the second most popular way to modify your WordPress URL. You should be aware that while utilizing this technique, all values in wp-config.php take precedence over the settings in your WordPress admin.

You only need to add your website URLs to your wp-config.php file to use this method. This file is located in your website’s root folder.

Before altering this file, you must first access your website with an FTP program. The wp-config.php file, which is located in your website’s root directory, may then be discovered.

You must add the following code directly above the line that reads, “That’s all, quit editing! ” in your wp-config.php file. Happy publishing!”

define( ‘WP_HOME’, ‘https://yoursite.com’ );
define( ‘WP_SITEURL’, ‘https://yoursite.com’ );

Remember to substitute your domain name with https://yoursite.com.

After finishing, you must save and exit your wp-config.php file.

Those two fields on this page are now grayed out when you return to the General settings screen from your WordPress dashboard. And there is no way to alter them other than by deleting the two lines of code in wp-config.php.

Method 3: Change WordPress site URLs using the functions.php file

For people who are unable to access their WordPress dashboard, this option is appropriate.

You must first use an FTP client to access your WordPress website. You must find your WordPress theme folder after connecting to your WordPress website.

Let’s just click on your theme folder under wp-content > themes.

To update the WordPress URL in the database, enter the functions.php file in your theme folder and make the necessary changes at the bottom of the file.

update_option( ‘siteurl’, ‘https://yoursite.com’ );
update_option( ‘home’, ‘https://yoursite.com’ );

In a similar manner, you must replace the URL in our code with the URL of your own website. You may now upload the file back to your server via FTP by selecting the “Save Changes” option.

You may update your site URLs in the database using this approach, which is one of its benefits. Additionally, WordPress will update the database for your site URLs after your functions.php file has been loaded.

Additionally, if your website is operating properly, you may remove the two lines of code from your WordPress functions.php file.

After altering your WordPress URL, how to establish a redirect

You must now send visitors to your site to the new URL after changing your WordPress URL in order to prevent 404 issues and improve user experience.

One of the finest WordPress backup plugins must be used to create a replica of your current site, which must then be transferred to a new domain.

The next step is to set up a redirect from your old site to your new one.

If you want further assistance, please go to our tutorial on how to create 301 redirects in WordPress to reroute individual posts and pages as well as other things.

In conclusion

These are the most popular techniques for quickly changing your WordPress URL. We hope that our blog offers you some helpful advice.

Please feel free to remark below if you have any problems. We are always ready to assist you.

Additionally, if you want to make your website’s aesthetic stand out, have a look at our free WordPress themes, which feature a variety of twelve different styles.