Learn how to change your WordPress URL (4 step-by-step methods)

Many users face problems when changing the WordPress URL, and this is a task that will be necessary at some point. However, there are ways to make the change outside the Admin area. Editing “functions.php” and “wp-config.php” files are some of the recommended paths.

Updated: May 17, 2022
how to change wordpress url with 4 easy methods

Need content for your business? Find top writers on WriterAccess!

So you need to change your WordPress URL?

URLs added to the WordPress platform are addresses that deserve attention because they are directly related to the management of blog files and the way your business appears in the search results performed on the Internet.

Based on this, you will have to change your WordPress URL several times. The question is — do you know how to do it?

If the answer is “no”, don’t worry. We’ve developed an exclusive step-by-step process with 4 easy methods to help you with this task. So, enjoy the tips below and learn about some of the main questions users have about it!

Download this post by entering your email below

Do not worry, we do not spam.

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.

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.

What are the most frequently asked questions about changing the WordPress URL?

Even with the step-by-step, some people find it hard to make WordPress URL changes. Because of that, we’ve listed below some of the most frequently asked questions among users and how to solve the problems. Keep up!

Why are the fields “WordPress Address” and “Site Address” blocked?

In many cases, the fields “WordPress Address” and “Site Address” in the platform Admin area may be blocked for editing actions. That is usually because the URLs are encoded in the “wp-config.php” file.

So, to make the changes, you must follow another path. Method 3, presented above, will work better.

Why do I need to change the URL of the website and WordPress separately?

This can be confusing, especially for beginners, because each field defines a URL for a given function, and they can have the same description (the same link for both fields).

Therefore, “WordPress Address” is a URL that allows access to your blog’s folders and files. In other words, it is a link more focused on blog administration, with media files, plugins, templates, etc.

The “Site Address” field defines the URL that will be accessed by web users. That is, it is a public address, which will appear in the results of online searches, keeping access to the administration pages of the blog blocked.

In the case of large companies, which host their websites and blogs on various servers, these URL addresses may be different, keeping some applications isolated from others.

This multiserver strategy is what guarantees security, availability, and stability of the digital services offered.

How to undo the change and recover the old URL?

Out of curiosity or for learning purposes, some people may accidentally change WordPress URLs when they are working on the platform’s Admin area, not knowing how to undo this action.

However, you can reverse the changes by following the steps described in methods 2, 3, and 4 in case you don’t have access to it in the Admin section.

Is there a plugin that makes it easier to change URLs?

Yes, you can use the “Velvet Blues Update URLs” or the “Better Search Replace” plugins. They allow you to update URLs in bulk. That is, with those plugins, you can change the URL of all the blog and/or site pages at once, using only one configuration screen.

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!

<!–[if lte IE 8]>
<![endif]–>Download the free infographic to understand how speed impacts your site
hbspt.cta.load(355484, ’47f60a2c-ba01-437b-a5b5-dff3a81a6f58′, {});
Share
facebook
linkedin
twitter
mail

Human Crafted Content

Find top content freelancers on WriterAccess.

Human Crafted Content

Find top content freelancers on WriterAccess.

Subscribe to our blog

Sign up to receive Rock Content blog posts

Rock Content WriterAccess - Start a Free Trial

Order badass content with WriterAccess. Just as we do.

Find +15,000 skilled freelance writers, editors, content strategists, translators, designers and more for hire.

Want to receive more brilliant content like this for free?

Sign up to receive our content by email and be a member of the Rock Content Community!

Talk to an expert and enhance your company’s marketing results.

Rock Content offers solutions for producing high-quality content, increasing organic traffic, building interactive experiences, and improving conversions that will transform the outcomes of your company or agency. Let’s talk.