Trusted WordPress tutorials, when you need them most.
Beginner’s Guide to WordPress
25 Million+
Websites using our plugins
Years of WordPress experience
WordPress tutorials
by experts

How to Fix WordPress Redirecting to Old Domain After Migration

Editorial Note: We earn a commission from partner links on WPBeginner. Commissions do not affect our editors' opinions or evaluations. Learn more about Editorial Process.

Do you want to fix the issue of redirecting to an old domain?

When you migrate a WordPress website to a new domain, there is a possibility that users will be redirected back to the old domain.

In this article, we will show you how to fix WordPress redirecting to an old domain after migration.

How to fix WordPress redirecting to old domain after migration

What Causes Redirection to Old Domain After Migration Issue?

When you’re moving your WordPress website to a new domain, it is important to set up redirection. This way, users automatically land on the new location, and you get to keep your keyword rankings and traffic.

However, redirection to a new domain may not work properly, and your visitors would be redirected back to the old domain.

One of the main causes for this issue is that your site URL and home URL values are different in the WordPress database tables. You need to make sure that both these values lead to your new domain.

Besides that, DNS issues can also cause users to redirect to the old domain after migration. If the DNS server is not responding or DNS records haven’t been updated, then your visitors won’t be able to view your new website URL.

That said, let’s see how you can fix WordPress redirecting to the old domain after migration. We will cover different methods, so you can click the links below to jump ahead to your preferred section.

Method 1: Update the Site Address in WordPress Settings

The easiest way to fix this issue is by ensuring that the WordPress address and site address is the same in your WordPress settings.

If your Site Address (URL) still shows the old domain, then users will be redirected to the previous URL after migration.

To fix this, simply head to Settings » General from your WordPress admin panel. After that, enter your new domain under the ‘Site Address (URL)’ field.

Site address URL

Once you’re done, save your changes and visit the new domain to see if the problem is resolved.

If, however, the URL fields are greyed out and won’t let you type a new address, continue reading and use one of the other methods to redirect your domain.

Method 2: Changing Site URL in WordPress Database

Another method of fixing the redirecting to the old domain issue is by updating the site URL in the WordPress database tables.

You can easily access the database using the cPanel provided by the WordPress hosting service.

For this tutorial, we will be using Bluehost as an example, but the process is similar for other hosting companies like Hostinger, SiteGround, etc.

First, you’ll need to log in to the hosting service control panel. After that, you can go to the Websites tab from the left menu. From here, simply click the ‘Settings’ option for your website.

Go to site settings in Bluehost

Next, you will see details of your website and different settings.

You can scroll down to the Quick Links section and click the ‘phpMyAdmin’ option.

Open the phpMyAdmin panel

After that, you will need to wait for a few seconds until phpMyAdmin opens.

Once it opens, you will need to go to the wp_options table from the navigational panel on your left.

Do note that each hosting service has a different naming convention for database tables. However, the one you’re looking for will always end in ‘_options.”

For example, in this tutorial, we will click the ‘staging_45f_options’ table in Bluehost’s phpMyAdmin.

Open the options table

Next, you will need to edit the ‘siteurl’ and ‘home’ options.

First, go ahead and click the ‘Edit’ button for ‘siteurl’ option.

Enter siteurl

After that, you will need to enter the new domain name in the option_value field. Once that’s done, simply click the ‘Go’ button.

Now, you can return to the main wp_options page and edit the ‘home’ option.

Enter the home field value

Next, you will need to enter the new domain in the option_value field.

After entering the value, click the ‘Go’ button.

Method 3: Flush DNS Cache on Your PC

If you’re still unable to resolve the issue of the old domain redirecting after migration, then you should check the DNS settings.

At times, it can take up to 12 to 48 hours for the change of domain name to take effect. As a result, internet providers that don’t have updated DNS records will redirect users to the old domain.

You simply flush the DNS cache so that it gets the latest information and the new website URL. This also helps resolve the DNS server not responding issue.

For more details, please see our guide on how to clear your DNS cache on Mac, Windows, and Google Chrome.

Pro Tip: Use SEO Plugin to Perform Full Site Redirect

When you manually perform redirection to a new domain, there is always a chance of errors. As a result, users would still be redirected to the old domain.

An easier way of setting up redirection is by using a WordPress SEO plugin like All in One SEO (AIOSEO). It offers a powerful redirection manager that you can use to redirect your entire site to a new domain without any issues.

Full site redirect in All in One SEO

This tool was built by our team, and it is what we use when we’re migrating websites to a new domain or merging two sites into one. You can learn more by following our step-by-step guide on how to properly do a full site redirect in WordPress.

We hope that this article helped you learn how to fix WordPress redirecting to an old domain after migration. You may also want to see our guide on the most common WordPress errors and how to fix them and our expert picks for the must-have WordPress plugins for business sites.

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.

Disclosure: Our content is reader-supported. This means if you click on some of our links, then we may earn a commission. See how WPBeginner is funded, why it matters, and how you can support us. Here's our editorial process.

Editorial Staff

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi with over 16 years of experience in WordPress, Web Hosting, eCommerce, SEO, and Marketing. Started in 2009, WPBeginner is now the largest free WordPress resource site in the industry and is often referred to as the Wikipedia for WordPress.

The Ultimate WordPress Toolkit

Get FREE access to our toolkit - a collection of WordPress related products and resources that every professional should have!

Reader Interactions

7 CommentsLeave a Reply

  1. Syed Balkhi says

    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!


    I have once had a wordpress site with a different domain and now want to migrate it to my new domain. Please how do I do redirects so that people who visit to land in

  3. Moinuddin Waheed says

    This is very common issue when migration to a new domain or new server.
    The url redirects to the old domain name and it keeps doing so.
    I think using AIOSEO and doing full site redirects audit will give the exact reasons for redirect and we can resolve this easily.

  4. Johan says

    Very clear, but doesn’t work for me. I copied a backup from the host to my localhost. Changed everything I could find to the localhost, but it keeps redirecting me to the live website. WP Admin does work locally, it’s just the website.

    Am I missing something?

Leave A 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.