Changing your WordPress website’s URLs can sound scary to beginners, but it is an important skill. Many of our readers have asked us about the correct way to do it.
Over the years, we have helped website owners change their URLs when moving from HTTP to HTTPS, switching domain names, transferring to a subdomain, migrating from a local server to a live site, and even when they were just restructuring their content.
We can help you too. This article will show you how to easily change your WordPress site URLs step by step, making sure you have a smooth transition without broken links or SEO problems.
Why Change WordPress Site URLs?
There are many reasons why you might need or want to change your WordPress URLs:
- You need to update site URLs when moving WordPress from a local server to a live site.
- If you have moved your WordPress site to a new domain name, then you will need to change site URLs to reflect the change.
- You need to change the site URLs because you are moving WordPress to a different directory, such as removing /wordpress/ from your WordPress URL.
- You will also need to change URLs when moving WordPress from HTTP to HTTPS.
Aside from that, you may need to change the WordPress address settings if you are seeing the too many redirects error in WordPress or when troubleshooting another WordPress error.
What’s the Difference Between WordPress Address vs. Site Address?
When changing your WordPress URL, you will need to update two separate settings: the WordPress address and the site address.
This can be confusing for many beginners because they don’t know the difference between the two settings:
- Your WordPress address (URL) is the address where your WordPress files and folders are stored, including your admin pages, media files, plugins, themes, and more.
- Your site address (URL) in WordPress is the public-facing part of your website. This is what your visitors will type into their web browsers to reach your website.
For the majority of users, the WordPress address and site address URLs will be the same.
However, in some cases, large companies may host their WordPress sites on a different server because their corporate website has many other applications, and they want to isolate where each app is hosted to improve WordPress security.
With that said, let’s take a look at how to easily change WordPress website URLs. Simply use the quick links below to jump straight to the method you want to use:
- Change WordPress Site URLs From Admin Area
- Change WordPress Site URLs Using functions.php File
- Change WordPress Site URLs Using wp-config.php File
- Change WordPress Site URLs in the Database Using phpMyAdmin
- Change WordPress Site URLs Using AIOSEO Plugin
- Frequently Asked Questions (FAQs) About Changing WordPress URLs
- Expert Guides on URLs in WordPress
Method 1: Change WordPress Site URLs From Admin Area
This method is the easiest and most beginner-friendly. If you have access to your WordPress admin panel, then we recommend using this method.
Simply log in 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.
As we said, for most websites, these will be the same URL.
After that, click the ‘Save Changes’ button to save your URL changes.
Now, you can visit your website to make sure that everything is working OK.
Method 2: Change WordPress Site URLs Using functions.php File
If you can’t access your WordPress admin panel, then you will need to use this method.
First, you need to connect to your WordPress site using an FTP client. For more details, see our guide on how to use FTP to upload files to WordPress.
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 using your preferred text editor, like Notepad or TextEdit.
Then, you need to add the following code to the bottom of the file:
update_option( 'siteurl', 'https://example.com' );
update_option( 'home', 'https://example.com' );
Don’t forget to replace https://example.com
with your own site URLs. You can now save your changes and upload the file back to your server using FTP.
Now, simply visit your website to see if everything is back to normal.
The advantage of this method is that it updates the site URLs in the database. WordPress updates the database for site URLs every time your functions.php file is loaded.
Once your website is working properly, you can remove the two lines of code from your WordPress theme’s functions.php file.
Method 3: Change WordPress Site URLs Using wp-config.php File
If you are not sure which WordPress theme you need to edit or can’t find your functions.php file, then you can use this method.
You will need to add your website URLs to your WordPress configuration file, which is called wp-config.php. This file is located in the root folder of your website and contains important WordPress settings.
To change this file, you will need to connect to your website using an FTP client. For more details, see our guide on how to use FTP to upload files to WordPress.
Then, you need to locate the wp-config.php file, which can normally be found in the root folder for your domain.
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' );
Don’t forget to replace https://example.com
with your own domain name.
You can now save your changes and upload the file back to your server. After that, visit your website to make sure that everything is working fine.
Method 4: Change WordPress Site URLs in the Database Using phpMyAdmin
Another way to update WordPress site URLs is by changing them directly in your WordPress database. You can do this directly from your WordPress hosting account dashboard.
Before you do this, we recommend making a WordPress database backup. This is really important and will help you undo any WordPress database changes if anything goes wrong.
For more details, see our guide on how to make a WordPress database backup.
After that, you need to log in to your web hosting account dashboard and click on the ‘phpMyAdmin’ icon in the ‘Databases’ section.
Note: The steps might be slightly different depending on your hosting provider. However, all cPanel hosting providers, like Bluehost, give you the ability to edit database settings.
This will automatically launch the phpMyAdmin application, which gives you a web-based interface to edit MySQL databases. To learn more, see our beginner’s guide to WordPress database management with phpMyAdmin.
First, you need to click on your WordPress database in the left-hand column. This will display tables inside your WordPress database.
Then, click on the ‘wp_options’ column option.
By default, the database prefix is ‘wp_’, but since you can change your WordPress database prefix, it might be something different.
Now, you’ll see rows inside the options table. You need to locate the ‘option_name’ column where ‘siteurl’ and ‘home’ will be listed.
First, click on the pencil ‘Edit’ icon to the left of each row and change the ‘option_value’ field to your new site URL.
You may need to scroll down the options table to find the ‘home’ option name.
After that, simply click the ‘Go’ button in the bottom right corner to save your database changes.
Now, you can visit your website to make sure everything is working as it should.
Method 5: Change WordPress Site URLs Using AIOSEO Plugin
All of the methods above will help you change the URL of an existing WordPress installation. This method works a little differently since you will be making your current WordPress URL point to the URL of a new WordPress installation.
This is common when you are moving your WordPress website to a new domain name and don’t want to lose rankings or experience downtime.
The best way to do this is with the AIOSEO plugin. It is the best WordPress SEO plugin on the market, used by over 3 million websites.
Note: There is a free version of the plugin available, but the AIOSEO Pro version is the only way to redirect your entire website, posts, pages, and more without losing your SEO rankings.
It has a built-in redirection manager that lets you create entire website redirects easily.
Redirecting your website this way preserves the links from sites that were linking to your old domain, prevents 404 errors, and creates a better experience for your visitors.
To do this correctly, you will need to create a duplicate of your existing site, move it to a new domain, and then redirect your old site to your new site.
You can learn more in our guide on how to update URLs when moving your WordPress website.
If you want to redirect single posts and pages in WordPress, then see our beginner’s guide to creating 301 redirects in WordPress.
Frequently Asked Questions (FAQs) About Changing WordPress URLs
Over the years, we have helped hundreds of thousands of users create a WordPress website, start a blog, or start an online store.
Throughout this time, we have answered many different questions related to changing WordPress URLs. Below are some of the most frequently asked questions we receive.
Why are my WordPress Address and Site Address fields greyed out?
If the WordPress address (URL) is greyed out on the settings page of your admin area, then it means the URLs are hardcoded in the wp-config.php file.
To change your WordPress URL, you will need to follow the fourth method above to edit the wp-config.php file and change the URL accordingly.
How do I recover my WordPress site after accidentally changing the URL settings?
Sometimes, non-techy users can accidentally change the WordPress URL and site address settings from the WordPress admin area.
To recover from that, you will have to follow our instructions above to change the WordPress URLs back by editing functions.php, wp-config.php, or the WordPress database.
Is there a WordPress plugin that can update URLs in all blog posts, pages, and other content areas in bulk?
Yes, you can use the Go Live Update URLs plugin.
When you change your WordPress URL, you will need a way to bulk update links through your WordPress posts, pages, and other areas in your database. This plugin is a huge time saver.
Aside from using it to update URLs when moving websites, we also use it to migrate websites to WordPress from various other platforms, such as moving from WordPress.com to WordPress.org, Wix to WordPress, Weebly to WordPress, and more.
Expert Guides on URLs in WordPress
We hope this article helped you easily change the WordPress site URLs. You may also want to see some other articles related to WordPress URLs:
- What is a Website URL (Important Parts Explained for Beginners)
- What is a SEO Friendly URL Structure in WordPress
- How to Change the Default Search URL Slug in WordPress
- How to Easily Update URLs When Moving Your WordPress Site
- How to Remove Numbers From WordPress URLs
- How to Remove Parent Slug From Child Page URL in WordPress
- How to Remove v=XXXX String From WordPress URLs
- How to Add a Custom Login URL in WordPress (Step by Step)
- How to Get the URL of Images You Upload in WordPress
- How to Get the Post Thumbnail URL in WordPress
If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.
Syed Balkhi
Hey WPBeginner readers,
Did you know you can win exciting prizes by commenting on WPBeginner?
Every month, our top blog commenters will win HUGE rewards, including premium WordPress plugin licenses and cash prizes.
You can get more details about the contest from here.
Start sharing your thoughts below to stand a chance to win!
Henry
Hello Wpbeginner, i want to change my site from /mysite.com to /www.mysite.com. just the www differ. i want to ask, the backlinks which i have built using the https:// version will it redirect passes link juice to the www version?
.
WPBeginner Comments
This can be changed by editing the Site URLs in the dashboard under Settings > General.
The “link juice” should be fine in this case. That said, for best results we recommend creating 301 redirects.
Jiří Vaněk
Do I understand correctly that method number 5 will help me migrate the site and redirect all urls to the new domain? So it only overwrites the domain but leaves the rest of the URL the same?
WPBeginner Support
It would redirect your posts and pages as well.
Admin
Jiří Vaněk
Yes, that was exactly the intention (it’s about migrating to another domain), and thank you for confirming my assumption. Redirecting the pages and articles is precisely what I need to achieve the desired result.
nine
hi, my colleague used the first method and although the page still exists we cannot log into the wordpress admin site. any suggestions where do I need to revert?
I tried all the other methods in hopes that it would help but to no avail
WPBeginner Support
It would depend on what issue you are having when attempting to log into your site, you should be able to use one of the other methods from the article above to revert the address to the correct URL.
Admin
Tomasz Lukomski
Thanks. Save my whole website!
WPBeginner Support
Glad our article was helpful!
Admin
LittleDrop
404
Sorry we couldn’t find that page.
It looks like nothing was found at this location. Maybe try one of the links below or a search?
above is the error message.
please what to do?
WPBeginner Support
If you were changing your site’s URLs to the correct URL and it is showing that 404 error, you would want to reach out to your hosting provider and they can normally assist with setting up redirects to the correct URL.
Admin
An
When I change my website URL from http to https: all looks ok.
however, every time I log out and log in again, the URL is changed back to http
I tried changing from the wordpress admin panel and directly in the database, but the changes are always undone when I log in again.
Any idea what might be causing this?
WPBeginner Support
You may want to check with your hosting provider as some have systems in place to prevent changes in your domain unless they are updated. You would also want to clear your cache if you have it enabled as that is another common cause for that issue.
Admin
Nate Garner
Do I change the URLs before I change the domain DNS or after? I want as little down time as possible.
Thanks
WPBeginner Support
You shouldn’t need to edit your DNS unless you are looking to change your domain. If you are looking to change your domain then you would want to take a look at our guide on how to do so below:
https://www.wpbeginner.com/wp-tutorials/how-to-properly-move-wordpress-to-a-new-domain-without-losing-seo/
Admin
Joseph
Thank you guys. I mistakenly altered both my WordPress and site URLs and I couldn’t access the site. Whenever I typed localhost/mysite it returned the error 404. But thanks to this article, I’ve found peace now. Much love.
Niuta
You have big thumbs up!
WPBeginner Support
Glad our guide was helpful
Admin
Dev Shah
I have already changed my site URL, now I want to change my internal browsing URLs like
my site: xyz.com
Now if I go to about us page
the URL should become : xyz.com/about
Is this possible by wordpress?
WPBeginner Support
You would want to modify your permalinks for what you want, you can see our guide on that below:
https://www.wpbeginner.com/wp-tutorials/how-to-create-custom-permalinks-in-wordpress/
Admin
Michael Feinsinger
Thanks. I used method 4. phpmyadmin. worked great!
WPBeginner Support
Glad to hear our guide helped
Admin
Gary Sim
Can site url and home and be different?
My site will not work on https with www. in
So can I change site url to https:/www.example in config and not home address.?
WPBeginner Support
You would want to reach out to your hosting provider and they can help with solving that problem as well as what is allowed/required on their hosting.
Admin
Chris W
Method 3 worked like a charm! Thank you so much
WPBeginner Support
Glad our guide was helpful
Admin
Frans
I’ve already tried all options .. but nothing works!
Changing the url is not a problem, but after that nothing works anymore.
WPBeginner Support
You would want to ensure the domain you changed your site to is set up properly. If you reach out to your hosting provider they should be able to assist
Admin
Alina Rekena
Thanks for the article! But for me the domain still doesn’t work, it shows that it can’t find the server of my domain. I have entered DNS records (nameservers) for the domain. Where to look for the problem?
WPBeginner Support
You would want to reach out to your hosting provider to ensure the domain is connected on their end correctly.
Admin
Mariam Anderson
I was messing around with settings and thought I broke my site. Method #2 worked beautifully. Thank you!
WPBeginner Support
Glad our recommendation was able to help
Admin
Aldo
I am building a WP site on localhost, and will use Duplicator to move it to an online host. What should the WP Address and Site Address be set to before I run Duplicator and migrate the site?
WPBeginner Support
You would want to take a look at our guide on how to move your site from a local installation to a live site below:
https://www.wpbeginner.com/wp-tutorials/how-to-move-wordpress-from-local-server-to-live-site/
Admin
Samantha Surage
My wordpress url is on my subdomain and I want to change my site url to my domain. I made the change in my admin area however, I am not seeing the effects of this change in the front end. Would I still need to rn the url replace plugin for it to work?
WPBeginner Support
For what it sounds like you’re wanting, you would want to take a look at our guide below:
https://www.wpbeginner.com/wp-tutorials/how-to-properly-move-wordpress-from-subdomain-to-root-domain/
Admin
Steve Shorr
When I go to general >settings
I don’t see the web address
WPBeginner Support
You may be on WordPress.com, we cover the difference between the two in our article below:
https://www.wpbeginner.com/beginners-guide/self-hosted-wordpress-org-vs-free-wordpress-com-infograph/
Admin
Rita Smith
The two update plugins you recommend are not tested and may not work with the newest version of wp.
WPBeginner Support
We would still recommend those plugins for the moment, for that specific warning you would want to take a look at our article below:
https://www.wpbeginner.com/opinion/should-you-install-plugins-not-tested-with-your-wordpress-version/
Admin
Sacha
I tried to create a website with wp today, however I changed the urls and now don’t have access to wp dashboard. Can you help me pls?
WPBeginner Support
You would want to revert the address to the old URL and reach out to your hosting provider
Admin
Sacha
Thanks for the reply, since i dont have access i need to do it through pho or client file? If so is there a more detailed explanation please? Its my first time and everything is new for me. Thanks so much
WPBeginner Support
It would depend on the access you do have, the above article covers our recommended methods for changing the address.
Bill Mundhausen
This option (the easy one) “This method is the easiest. If you can already access the WordPress admin area, then we recommend using this method. Simply login to your WordPress website and go to Settings » General page. From here you can change WordPress site URLs under the ‘WordPress Address’ and ‘Site Address’ options. ” It doesn’t exist.
WPBeginner Support
The most likely reason you do not have that would be if you are on WordPress.com, if you are then you would not have this option. For a comparison of WordPress.com and WordPress.org you would want to take a look at our article below:
https://www.wpbeginner.com/beginners-guide/self-hosted-wordpress-org-vs-free-wordpress-com-infograph/
Admin
Amit Patil
Thank you soo much, this post has been a great help.
Php option worked for me
WPBeginner Support
Glad our guide was helpful
Admin
Darwish
Thank you so much, you don’t how much i search for a solution for this .. i even contacted my host and they couldn’t know how to do it …. Method 3 solved it .
you’re really my trusted source for everything wordpress .
again thank you so much .
WPBeginner Support
Glad our recommendations were able to help
Admin
Omolewa Adetola
Hello,I am worried that if I change my site address, I’ll lose all the files on the previous URL and be unable to redirect or reach the former site. That would mean a loss of all my blog posts, wouldn’t it? What can I do, please?
WPBeginner Support
If you’re looking to change your site to a new domain specifically, we would recommend taking a look at our article below:
https://www.wpbeginner.com/wp-tutorials/how-to-fix-destination-folder-already-exists-error-in-wordpress/
Admin
Harsh Patel
Hello
After I changed the URL Site Address from WordPress Dashboard and then I changed from the cPanel Account after doing this my site is still displaying that This site can’t be reached.
What can I do?
WPBeginner Support
You would want to reach out to your hosting provider to ensure you set up the domain properly
Admin