Why do you need to know how to change WordPress URL?
There are many reasons why you may need to change a WordPress URL. The main ones are:
- Change the HTTP transfer protocol to HTTPS
- Change the domain due to SEO strategy issues
- Migrate the website and/or blog from one server to another
Also, you may need to change the WordPress address settings if the page has many redirection errors. This problem is common after a while online.
Therefore, finding out how to change the URL will allow you to solve problems without needing to hire a programmer, reducing costs and risks of making mistakes in the process.
How to change the WordPress URL? 4 easy methods
Now that you know how important it is to learn the process, check 4 different ways to change your WordPress URL quickly and easily!
Method 1: using the Admin area
This is the easiest method to change the WordPress URL. However, not everyone has access to the Admin area. If this is not your case, access the platform and, in “Dashboard”, click on “Settings” and “General.
Now, just click on “WordPress Address” and “Site Address” fields to change the URL. Usually, both fields have the same address. At last, click on “Save Changes” to confirm the modifications and type the new website or blog URL in your web browser for testing.
While doing this, don’t be surprised if your site temporarily goes offline or displays a warning. It’s a common hiccup—and usually nothing to worry about unless you see a string of alarming error codes you don’t recognize. Give it a moment, clear your browser cache, and try accessing the site again; sometimes, changes just take a little while to kick in across servers.
It’s worth mentioning that, if you’re working with a multilingual or multisite setup, you’ll want to repeat this process for each site instance. Otherwise, you could end up with one part of your site working and another totally lost in the shuffle. That’s an easy trap to fall into, especially if you’re juggling more than a handful of URLs at once. Just double-check everything before calling it a day.
Method 2: using “functions.php” file
If you don’t have access to the WordPress Admin area, this will be the easiest way to change your URLs. So, access the platform’s website using an FTP Client, click on “wp-content”, “themes” and then “your-theme-folder”.
In the list of files that will appear, find the one named “functions.php”, right-click it and select the option “View/Edit”. Use an unformatted text editor such as Notepad or TextEdit to do this. Next, add the following codes at the bottom:
update_option( 'siteurl', 'https://example.com' );
update_option( 'home', 'https://example.com' ).
Replace the word “example” with the domain name of the blog or website. Now, just save the changes. A copy will be created on your computer, and you will have to upload the file with the changes in the same place it was hosted.
The benefit of this method is that it updates the URLs directly in the platform database. Then, to see if the change worked correctly, type the new URL in your computer’s web browser and hit “Enter” on your keyboard.
Method 3: using the “wp-config.php” file
This method is similar to the previous one, but just a bit more complex. Therefore, it is only recommended to use it when you cannot find the “functions.php” file.
To start the process, go to the WordPress website using an FTP Client and find the “wp-config” file. It is located in the root folder of your site.
After opening the file, above the line that says “That’s all, stop editing! Happy publishing”, add the following code:
define ('WP_HOME', 'https://example.com' );
define ('WP_SITEURL', 'https://example.com' ).
As with method 2, replace the word “example” with your site domain name, save the changes, and upload the new file to the original hosting location, replacing the previous one. Now, go to the website and check if the changes worked.
Method 4: using the “phpMyAdmin” database
If none of the previous steps work, you can change the WordPress URL by directly accessing the platform database. However, if you prefer this method, it is recommended that you make a backup of the files first to undo the changes in case something goes wrong.
To get started, go to your web hosting provider‘s dashboard and click on the “phpMyAdmin” icon. It is located in the “Database” section. Doing so will open a window that allows you to make the changes online.
Within the “phpMyAdmin” interface, you should click on “WordPress Database” in the left column, so a list of required files will appear. Use the scroll bar until you find the “wp_options” file and click on it.
Now, find the rows named “siteurl” and “home” in the “option_name” column. Then, click on “Edit” (pencil icon) to change the two lines in the “option_value” column. After that, click on the “Go” button in the lower right corner to save the changes made. Finally, go to the website to test the changes.
If you had to make each change individually, depending on the number of pages, the work would take too long. With plugins, on the other hand, you save a lot of time in the process.
These plugins are particularly useful in migration operations to other platforms and hosting servers, making URL changes easier.
Setting a user-friendly and easy-to-remember URL is part of the Digital Marketing strategy. Besides that, with the growth of the business, the site’s migration to virtual servers (cloud servers) will be inevitable over time.
For these reasons, you will have to change the WordPress URLs sooner or later. So, use this post as a guide to help you in the process.
Another thing you should have to know if you want to have a successful website is how your page speed impacts your sales. Check out this free infographic!