WPBeginner

Beginner's Guide for WordPress

  • Blog
    • Beginners Guide
    • News
    • Opinion
    • Showcase
    • Themes
    • Tutorials
    • WordPress Plugins
  • Start Here
    • How to Start a Blog
    • Create a Website
    • Start an Online Store
    • Best Website Builder
    • Email Marketing
    • WordPress Hosting
  • Deals
    • Bluehost Coupon
    • SiteGround Coupon
    • WP Engine Coupon
    • HostGator Coupon
    • Domain.com Coupon
    • Constant Contact
    • View All Deals »
  • Glossary
  • Videos
  • Products
X
☰
Beginner's Guide for WordPress / Start your WordPress Blog in minutes
Choosing the Best
WordPress Hosting
How to Easily
Install WordPress
Recommended
WordPress Plugins
View all Guides

WPBeginner» Blog» Tutorials» How to Change Your WordPress Site URLs (Step by Step)

How to Change Your WordPress Site URLs (Step by Step)

Last updated on October 17th, 2019 by Editorial Staff
111 Shares
Share
Tweet
Share
Pin
Special WordPress Hosting offer for WPBeginner Readers
How to Change Your WordPress Site URLs (Step by Step)

Do you need to change your WordPress URL? Whether you’re moving from HTTP to HTTPs, changing your domain name, migrating from local server to live site, or transferring to a subdomain, you will need to know how to change your WordPress site URL.

The WordPress address and site address are extremely important fields because they reference the address of your website on the internet and the location of your website files.

In this article, we will share four different ways to easily change your WordPress site URLs (step by step). This guide will specially come in handy when you are fixing common WordPress errors or moving a WordPress site.

Easily change your WordPress site URLs

Why Change WordPress Site URLs?

There are many reasons why you might need or want to change your WordPress URL. For example:

  • You may need to update site URLs when moving WordPress from local server to 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.
  • If you’re moving WordPress to a different directory such as removing /wordpress/ from WordPress url.
  • You will also need to change it when moving WordPress from HTTP to HTTPs.

Apart from that, you may need to change the WordPress address settings if you are seeing too many redirects error in WordPress or when troubleshooting another WordPress error.

WordPress Address vs Site Address

When changing WordPress site URL, you will need to update two separate settings: WordPress Address and Site Address.

This can be confusing for many beginners because they don’t know what’s the difference between the two settings.

Your WordPress Address (URL) is the address where WordPress files and folders are stored including your admin pages, media files, plugins, themes, etc.

Your Site Address (URL) in WordPress is the public facing part of your website. This is what your visitors will type in to reach your website. This is also the link that you put on your business cards.

For majority of users, the WordPress Address and Site Address URL will be the exact same link.

However in some cases, large companies may host their WordPress site on a different server because their corporate website has many other applications, and they want to isolate where each app is hosted.

But for majority of users, these two WordPress URLs need to stay the same.

That being said, let’s take a look at how to easily change WordPress site URLs. We will show you the following methods, and you can choose the one that works best for you.

  • 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

Ready? let’s get started.

Method 1. Change WordPress Site URLs from Admin Area

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.

Change WordPress site URLs in the admin area

WordPress Address and Site Address are usually the same address.

Don’t forget to click on the ‘Save Changes’ button to store your settings. You can now visit your website to make sure that everything is working OK.

Method 2. Change WordPress Site URLs Using functions.php File

This method is recommended for users who cannot access the admin area of their WordPress website.

Simply connect to your WordPress site using an FTP client and go to /wp-content/themes/your-theme-folder/.

Edit WordPress functions file

From here you need to locate the functions.php file and edit it using a plain text editor like Notepad or TextEdit.

Next, you need to add the following code at the bottom:

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 website hosting using FTP.

You can now 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 option for site URLs every time your functions file is loaded.

Once everything gets back to normal, don’t forget to remove the two lines of code from your WordPress functions file.

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

This method is only recommended if you are unsure which WordPress theme you need to edit or cannot find the functions.php file.

For this method, you will be adding the site URLs to your WordPress configuration file called wp-config.php. This file is located in the root folder of your website and contains important WordPress settings.

Simply connect to your website using an FTP client and edit the wp-config file. 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 them 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.

First, you need to make a WordPress database backup. This step is really important and will help you undo database changes in case anything goes wrong.

After that, you need to go to your web hosting account’s dashboard and click on the phpMyAdmin icon under the Databases section.

Note: Our screenshot is from Bluehost but most other WordPress hosting companies will also have the ability for you to edit database settings.

phpMyAdmin

Once you click the link, it will launch the phpMyAdmin app, which provides a web-based interface to edit MySQL databases. To learn more about it, see our guide on how to WordPress database management with phpMyAdmin

Inside phpMyAdmin interface, you need to click on your WordPress database from the left column. The app will now display tables inside your WordPress database.

Edit options table

Next, you need to scroll down to the options table. By default the database prefix is wp_ but since you can change WordPress database prefix, your screenshot may have a different prefix.

PhpMyAdmin will now display the rows inside the options table. You need to locate the rows where option_name is siteurl and home.

Edit siteurl and home values

Next, click on the pencil icon on the left to edit each row and change the option_value field to the new site URL. After that, click on the tiny Go button at the bottom right corner to save your database changes.

Edit option_value

You can now visit your website to see if everything is working fine.

Frequently Asked Questions (FAQs)

Over the years we have helped hundreds of thousands of users create a WordPress website, start a blog, or start an online store. In this time, we have answered many different questions related to changing WordPress URLs. Below are some of the most frequently asked questions.

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 that the URLs are hard coded in the wp-config.php file.

WordPress Address URL Greyed Out

To change your WordPress URL, you will need to follow method 3 in our article to edit the wp-config.php file and change the URL accordingly.

How to recover WordPress after url address change in settings?

Sometimes non-techy users can accidentally change WordPress URL and Site Address settings from the WordPress admin area. To recover from that, you will have to follow our guide above to change the WordPress URLs back using functions.php, wp-config, or the database method.

Is there a WordPress change URL plugin that can bulk update URLs in all blog posts, pages, and other content areas?

Yes, you can either use the Velvet Blues Update URLs plugin or the Better Search Replace 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. The above plugins are a huge time saver.

Aside from using them to update URLs when moving websites, we also use them for various other platform migrations such as moving from WordPress.com to WordPress.org, Blogger to WordPress, Weebly to WordPress, etc.

We hope this article helped you easily change the WordPress site URLs. You may also want to see our guide on the must have WordPress plugins, and how to speed up 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.

111 Shares
Share
Tweet
Share
Pin
Popular on WPBeginner Right Now!
  • How to Start Your Own Podcast (Step by Step)

    How to Start Your Own Podcast (Step by Step)

  • Revealed: Why Building an Email List is so Important Today (6 Reasons)

    Revealed: Why Building an Email List is so Important Today (6 Reasons)

  • How to Properly Move Your Blog from WordPress.com to WordPress.org

  • Error Establishing a Database Connection in WordPress

    How to Fix the Error Establishing a Database Connection in WordPress

About the Editorial Staff

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi. Trusted by over 1.3 million readers worldwide.

The Ultimate WordPress Toolkit

Comments

  1. Congratulations, you have the opportunity to be the first commenter on this article.
    Have a question or suggestion? Please leave a comment to start the discussion.

Leave a Reply Cancel reply

Thanks for choosing to leave a comment. Please keep in mind that all comments are moderated according to our comment policy, and your email address will NOT be published. Please Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.

Over 1,320,000+ Readers

Get fresh content from WPBeginner

Featured WordPress Plugin
MonsterInsights
MonsterInsights
Google Analytics made easy for WordPress. Learn More »
How to Start a Blog How to Start a Blog
I need help with ...
Starting a
Blog
WordPress
Performance
WordPress
Security
WordPress
SEO
WordPress
Errors
Building an
Online Store
Useful WordPress Guides
    • 7 Best WordPress Backup Plugins Compared (Pros and Cons)
    • How to Fix the Error Establishing a Database Connection in WordPress
    • Why You Need a CDN for your WordPress Blog? [Infographic]
    • 25 Legit Ways to Make Money Online Blogging with WordPress
    • Self Hosted WordPress.org vs. Free WordPress.com [Infograph]
    • Free Recording: WordPress Workshop for Beginners
    • 24 Must Have WordPress Plugins for Business Websites
    • How to Properly Move Your Blog from WordPress.com to WordPress.org
    • 5 Best Contact Form Plugins for WordPress Compared
    • Which is the Best WordPress Popup Plugin? (Comparison)
    • Best WooCommerce Hosting in 2019 (Comparison)
    • How to Fix the Internal Server Error in WordPress
    • How to Install WordPress - Complete WordPress Installation Tutorial
    • Why You Should Start Building an Email List Right Away
    • How to Properly Move WordPress to a New Domain Without Losing SEO
    • How to Choose the Best WordPress Hosting for Your Website
    • How to Choose the Best Blogging Platform (Comparison)
    • WordPress Tutorials - 200+ Step by Step WordPress Tutorials
    • 5 Best WordPress Ecommerce Plugins Compared
    • 5 Best WordPress Membership Plugins (Compared)
    • 7 Best Email Marketing Services for Small Business (2019)
    • How to Choose the Best Domain Registrar (Compared)
    • The Truth About Shared WordPress Web Hosting
    • When Do You Really Need Managed WordPress Hosting?
    • 5 Best Drag and Drop WordPress Page Builders Compared
    • How to Switch from Blogger to WordPress without Losing Google Rankings
    • How to Properly Switch From Wix to WordPress (Step by Step)
    • How to Properly Move from Weebly to WordPress (Step by Step)
    • Do You Really Need a VPS? Best WordPress VPS Hosting Compared
    • How to Properly Move from Squarespace to WordPress
    • How to Register a Domain Name (+ tip to get it for FREE)
    • HostGator Review - An Honest Look at Speed & Uptime (2019)
    • SiteGround Reviews from 1032 Users & Our Experts (2019)
    • Bluehost Review from Real Users + Performance Stats (2019)
    • How Much Does It Really Cost to Build a WordPress Website?
    • How to Create an Email Newsletter the RIGHT WAY (Step by Step)
    • 7 Best CRM Software for Small Businesses (Compared)
    • How to Create a Free Business Email Address in 5 Minutes (Step by Step)
    • How to Install Google Analytics in WordPress for Beginners
    • How to Move WordPress to a New Host or Server With No Downtime
    • Why is WordPress Free? What are the Costs? What is the Catch?
    • How to Make a Website in 2019 – Step by Step Guide
Deals & Coupons (view all)
Astra WordPress Theme
Astra Theme Coupon
Get 10% OFF on the purchase of Astra WordPress Theme.
Keep Your WordPress Content Safe with BackupBuddy
BackupBuddy Coupon
Get 25% off BackupBuddy, the best and most popular WordPress backup plugin.
Featured In
About WPBeginner®

WPBeginner is a free WordPress resource site for Beginners. WPBeginner was founded in July 2009 by Syed Balkhi. The main goal of this site is to provide quality tips, tricks, hacks, and other WordPress resources that allows WordPress beginners to improve their site(s).

Site Links
  • About Us
  • Contact Us
  • FTC Disclosure
  • Privacy Policy
  • Terms of Service
  • Free Blog Setup
Our Sites
  • OptinMonster
  • MonsterInsights
  • WPForms
  • SeedProd
  • Nameboy
  • RafflePress

Copyright © 2009 - 2019 WPBeginner LLC. All Rights Reserved. WPBeginner® is a registered trademark.

Managed by Awesome Motive | WordPress hosting by HostGator | WordPress CDN by MaxCDN | WordPress Security by Sucuri.