softmaji-header-wbg-min
softmaji-header-wbg-min
softmaji-blue-header-min
softmaji-blue-header-min
  • Home
  • Services
    • Website Designing
      • Responsive Website Design
      • Static Website Design
      • Website Redesign
      • Landing Page Design
    • Website Development
      • PHP Website Development
      • WordPress Website Development
      • Ecommerce Website Development
      • Custom Website Development
    • Digital Marketing
      • Google Adwords/PPC
      • Facebook Promotion
    • SEO Service
  • Trainings
    • Learn Web Development
    • Learn Graphics Design
    • Learn Business Communication Skills
  • Pricing
  • Portfolio
  • Events
  • Offers
  • Contact Us

What are the Steps to Change the WordPress Site URL?

HomeWhat are the Steps to Change the WordPress Site URL?

Offer Expire Soon..


Only New User..


It is possible to change the domain name for your WordPress site at any time you want to but you need to know some key setting prior to switching.

Ensure that you carefully follow the below steps to change the settings properly.

Table of Contents

Toggle
  • Why should you change the URL?
  • Case #1 —Moving from a subdirectory
  • Case #2 — Adding or removing www
  • Case #3 — Adding ‘https’ to the URL
  • Case #4 — Moving to a new domain
  • Different Ways to Change the WordPress URL
  • Option 1 – Change the HOME and SITE URL using phpMyAdmin
  • Option 2 – Changing the URLs in your wp-config.php file
  • Verifying the New HOME and SITE URL

Why should you change the URL?

In order to move a WordPress installation from one URL to a different one there are different cases:

Case #1 —Moving from a subdirectory

In this case, a WordPress site moves from a sub-directory to its parent domain. For example:

  • It moves from http://example.com/blog
    to
  • http://example.com

In case you have already moved your domain to a new URL, you won’t be able to log in as WordPress is configured to use the old URL.

Case #2 — Adding or removing www

The next reason to update your URLs is when you need to add or remove www from your domain. If previously it was example.com, you might want to change it to www.example.com.

When you change the URL, you might see a browser redirect error when after browsing your site. It might display the message as “Too many redirects” or “The page isn’t redirecting properly”.

Case #3 — Adding ‘https’ to the URL

In case you’re using an SSL certificate, the first part of the URL will change from ‘http’ to ‘https’. In case you’ve already made this change, you won’t be able to log in as WordPress is configured to use the old URL.

Case #4 — Moving to a new domain

Lastly, when a WordPress site moves from one fully hosted domain to a different one, you need to change the URL.

For example:

  • Move from http://example.com
    to
  • http://milesweb.com

Different Ways to Change the WordPress URL

Note: Check the below two options that explain the ways to change your HOME and SITE URL for immediately getting the access to your WordPress site and dashboard.

After you log in, to update all the URLs in your database to the new URLs, you will need to use a plugin. Check the below article for complete instructions:

How to Switch Your WordPress Database URLs to HTTPS With a Plugin?

Option 1 – Change the HOME and SITE URL using phpMyAdmin

If you have made any of the changes above, you won’t be able to log in to your dashboard. Instead of that, use the phpMyAdmin to update the HOME and SITE URLs.

1. Open phpMyAdmin.

2. In the left pane, click your database. You will see a list of several tables below it. Click on your wp_options table.

3. Find the ‘siteurl’ and ‘home’ rows. In order to edit, click the pencil icon next to each.

4. You will see “browse” when you scroll over these options.

Again to edit, click on the pencil icon next to each.

5. Type a new URL for altering the previous one.

6. To save the settings, click the Go button. This needs to be done for both the ‘siteurl’ and ‘home’ options.

After this is completed, you will be able to log into your site at example.com/wp-login.php.

Though you get an access to your site, there might be some former URLs in your database which will still use the old URL. Now you will need to use a plugin to update all URLs in your database to the new URL.

Option 2 – Changing the URLs in your wp-config.php file

It is possible to change the URLs in your wp-config.php file. This is a bit easier as compared to editing your database and gives you quick access to your site.

Note: In the following steps, it is assumed that your Home and Site URL should be ‘example.com’.

Use FTP or SSH to log in to your site.

Go to the WordPress directory and edit the file named ‘wp-config.php’.

Now, add the following lines in that file just above /* That’s all, stop editing! Happy blogging. */.

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

When you visit the site now, check if you can log in.

You will get immediate access to your site but the database won’t be configured to use the correct HOME and SITE URL. It is important to use a plugin to update all URLs in your database to the new URL.

Verifying the New HOME and SITE URL

In case you have used the first option from above, the HOME and SITE URLs must have been updated in the database. You can verify that your site is now using the correct URLs in your dashboard.

1. Log in to your WordPress Dashboard.

2. Go to Settings > General.

3. Here you will be able to view the HOME and SITE URL your WordPress site is configured to use.

Note: In case you have used the second option, the database won’t update your HOME and SITE URL. Go to the Settings > General page where all the entries are grayed out with the values that you entered in your wp-config.php file:

To update all URLs in your database to the new URL, you should use a plugin.

After updating, remove the lines from your wp-config.php file. Recheck the Settings > General page and check that those fields aren’t seen grayed out.

This is the way you can change the WordPress site URL.

Faizan Khan
11
Latest News
Prev PostSteps to Add Sites to WordPress MultisiteMay 14, 2024
Next PostWhat is the WordPress ‘Too Many Redirects’ Error and What are Its Causes?May 14, 2024

Related items

otpless-issue
Latest News

OTPLess Not Working? Here’s What Happened!

Imagine this: You run a business, and suddenly, your customers can’t log in to your websit

SoftMaji InfoTech
20/06/2025
7
Latest News

How To Install WordPress Blog?

Let’s see how to install WordPress blog on your WordPress hosting account. Let’s

Faizan Khan
14/05/2024
149
Latest News

How to Install a Theme in WordPress?

Steps to install a theme in WordPress: Log in to WordPress. Navigate to Appearance and cli

Faizan Khan
14/05/2024
135
softmaji-header-wbg-min
SoftMaji is one of the affordable web development company in the web development industry. You don’t have to go searching anywhere for finding a reliable web development partner because we have crafted web development solutions that can fill the void left by others in the market.
Services
  • News Portal Development
  • Custom Website Development
  • PHP Website Development
  • Ecommerce Website Development
  • WordPress Website Development
Shortlinks
  • Blog
  • Offers
  • Events
  • Pricing
  • Reviews
  • Portfolio
  • Our Team
  • Payment Options
  • Explore Packages
Company
  • FAQ
  • Careers
  • Sitemap
  • Feedback
  • About Us
  • Contact Us
  • Privacy Policy
  • Terms & Conditions
  • Refund And Cancellation
Contact Us
4/40 Vipul Khand , Gomti Nagar Lucknow
Uttar Pradesh 226010
Landline - +915223162418
Email - hello@softmaji.in
Office Time Mon - Sat
(10:00AM - 5:00PM)
Sunday Close
+91 9795405324
Lucknow , Uttar Pradesh
Copyright © 2022. All Rights Reserved.