Your WordPress accost and site address (or URL) are very important every bit they reference both the accost of your site on the spider web and the location of your site's files and admin screens.

There are many reasons why y'all might demand or want to alter your WordPress URL. Mayhap you're irresolute domains, moving to a subdomain, updating from www to non-www, moving files around, or even migrating from HTTP to HTTPS.

Whatsoever the case may be, at that place 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 y'all can use to change the URL of your WordPress installation and your WordPress site URL, which are two unlike things.

Prefer to watch the video version?

Alter WordPress URL via the Admin Dashboard

The commencement and most common method is to change your WordPress URL directly from within the admin dashboard. In the admin carte, get to Settings > General to access the general settings screen. You tin can so update the following:

  • WordPress Address (URL): The address to attain your site.
  • Site Address (URL): The accost of your WordPress cadre files.
General settings - WordPress URL
General settings – WordPress URL

Both should match unless you are giving WordPress its own directory. Call back that subsequently you click Salvage Changes, your WordPress dashboard is at present but attainable via the new URL. So be sure to check that you've entered the correct URL.

If you practise accidentally enter the wrong URL, you can override the settings in the admin screens past editing your wp-config.php file (was see the side by side method below).

Note: If the fields above are grayed out, information technology is most probable because you already have hard-coded values in your wp-config.php file. In which case, leap to the next method.

If you're creating a fresh WordPress installation on Kinsta hosting, you will be given a temporary URL, such every bit sitename.kinsta.cloud. You tin can utilise the directions above to update the address.

You might as well need to clear your WordPress cache after updating the URLs, otherwise y'all might receive a redirect mistake. If y'all're a Kinsta client, you can clear your cache from the MyKinsta dashboard under the Tools department for your site.

MyKinsta - clear cache
MyKinsta – articulate cache

Change WordPress URL in wp-config.php File

The second most mutual 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 (every bit seen below), it is most likely because they are hard-coded in this file.

WordPress change URL - General settings URL grayed out
General settings URL grayed out

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 ii lines somewhere above the line that tells you lot to stop editing:

          define( 'WP_HOME', 'http://yoursiteurl.com' ); ascertain( 'WP_SITEURL', 'http://yoursiteurl.com' );        

Salve 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 tin't edit them unless you remove those 2 lines from wp-config.php.

If you lot want access to those settings in your dashboard over again, all you need to do is remove them from your wp-config.php file.

Change WordPress URL Directly in Database

A 3rd method you can use to modify your WordPress URL is directly in the WordPress database. To practise this, y'all employ phpMyAdmin (which is attainable from your MyKinsta dashboard). This is normally done as a last resort.

Subscribe Now

Accessing phpMyAdmin in MyKinsta
Accessing phpMyAdmin in MyKinsta

In phpMyAdmin, click on your database on the left-hand side. Then scroll down and click on the "wp_options" table. If your database has a dissimilar prefix it might be named slightly differently, such as wp56_options.

phpMyAdmin - wp_options table
phpMyAdmin – wp_options tabular array

Then find the site url and home fields. Double click in the option_value field for each and type in the new URL.

WordPress change URL - phpMyAdmin
phpMyAdmin – editing URL

Your changes will automatically exist saved.

Modify WordPress URL With WP-CLI

A fourth option is to apply the WordPress Control Line Interface (WP-CLI) to access your site and edit the URL.

You'll demand SSH access to your site (which is provided to all Kinsta customers) and you'll need to be familiar with the process for accessing your site using WP-CLI.

If y'all are unfamiliar with WP-CLI y'all can check out our in-depth mail service on managing WordPress from the concluding.

The commands to edit your URL are as follows:

          wp option update home 'http://yoursiteurl.com' wp option update siteurl 'http://yoursiteurl.com'        

Change WordPress Login URL

Sometimes yous might desire to change the URL for your WordPress login just not for the live site.

Your login URL is normally your domain proper name followed by /wp-admin or /wp-login. But it'due south possible to modify information technology to something simpler to provide a meliorate user experience for your users and clients or to brand your site admin and remove obvious reference to WordPress.

You can change the WordPress login URL manually or past installing a plugin.

Redirection Subsequently Changing WordPress Urls

Later on you modify your WordPress URLs, yous need to brand sure that anyone using the old URL is redirected to the new URL and doesn't get an error.

If you're with Kinsta, you lot tin set up redirection using MyKinsta. Follow our knowledgebase guide to redirection to learn how to practise it and read our guide to redirect best practices to avert redirect errors like 'too many redirects' and find out how to set up it up so it doesn't impact your site's performance.

myKinsta redirection
Creating wildcard redirects in MyKinsta

You lot might also need to add together redirects for individual posts or pages, although wildcard redirection is more likely.

If you lot're not with Kinsta, detect out if your hosting provider lets you set upward wildcard redirection in your control panel.

Alternatively, yous could utilize a plugin similar Redirection to set upward a wildcard redirection from your erstwhile domain name to your new one.

If yous're running Yoast premium on your site and you need to edit the URL of individual posts or pages, the plugin will automatically gear up redirects for yous, and then you don't need to do this manually. Information technology also allows you to set Regex redirects which you can use when you lot change your site URL, if y'all know what you're doing. Our in-depth guide to redirects explains how Regex redirects work.

Summary

If you need to change your WordPress URL because you've switched domains or y'all're transferring to HTTPS, yous have a number of methods you can use to practise information technology.

You can change the settings in the WordPress admin, hardcode them in your wp-config.php file, edit the database, or use WP-CLI. Work through the methods above to find the one that works for your site, and you'll have your new WordPress URL working in no time.


Save time, costs and maximize site performance with:

  • Instant aid from WordPress hosting experts, 24/seven.
  • Cloudflare Enterprise integration.
  • Global audition reach with 33 data centers worldwide.
  • Optimization with our born Application Performance Monitoring.

All of that and much more, in one program with no long-term contracts, assisted migrations, and a 30-twenty-four hours-money-back-guarantee. Check out our plans or talk to sales to find the programme that'south right for you.