WordPress Redirecting to Old Domain After Migration

WordPress Redirecting to Old Domain After Migration
I write a weekly newsletter, sharing my articles and thoughts on building and running websites. There’s no spam and it’s totally free.
Join 1500+ subscribers!

Problem

I have moved my website to a new domain.

When I go to the new domain, WordPress redirects to the old domain.

Solution: Change Site URL in Database

You have to change the website url in the database.

You can do it through phpMyAdmin or a similar tool.

Manually edit the values for siteurl and home in the table wp_options.

Or you can run these updates:

UPDATE wp_options SET option_value = 'https://yournewdomain.com' WHERE option_name = 'siteurl';
UPDATE wp_options SET option_value = 'https://yournewdomain.com' WHERE option_name = 'home';

Obviously, replace “https://yournewdomain.com” with your actual new website url.

I write a weekly newsletter, sharing my articles and thoughts on building and running websites. There’s no spam and it’s totally free. Join 1500+ subscribers!