fbpx

How to change WordPress URL

Your WordPress address references both the address of your site on the web and the location of your site’s files and admin screens. Because of its importance, there are many reasons why you might need or want to modify it. 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.

This article will show you three different methods you can use to change the URL of your WordPress site.

1. Change WordPress Site URLs from Admin Area

Login to your WordPress dashboard and go to Settings » General.

Here, you can change your WordPress site URLs in the ‘WordPress Address’ and ‘Site Address’ boxes.

For most websites, these will be the same URL.

After that, click the ‘Save Changes’ button.

2. Change WordPress Site URLs Using functions.php File

If you cannot access your WordPress admin panel for any reason, then you’ll need to use this method.

First, you need to connect to your WordPress site using an FTP client.

Related: How to connect to your account using FTP?

Then, you need to locate your WordPress theme folder. For most users this will be something like /wp-content/themes/your-theme-folder/.

In this folder, you need to open your functions.php file and edit it. Add the following code to the bottom of the file:

update_option( 'siteurl', 'https://example.com' );update_option( 'home', 'https://example.com' );

3. Change WordPress Site URLs Using wp-config.php File

If you’re not sure which WordPress theme you need to edit, or can’t find your functions.php file, then you can use this method.

To change this file you’ll need to connect to your website using an FTP client. Then, you need to locate the wp-config.php file, which can normally be found in the root folder for your domain.

Related: How to connect to your account using FTP?

After that, you need to add the following code just above the line that says ‘That’s all, stop editing! Happy publishing’.

define( 'WP_HOME', 'https://example.com' );define( 'WP_SITEURL', 'https://example.com' );

If you are a Host Duplex customer and still have questions, please open a ticket in the Host Duplex client portal.

Updated on December 29, 2021

Was this article helpful?

Related Articles

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.