How to Fix WordPress Redirecting to Old Domain After Migration

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, simply 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, simply click on the ‘Advanced’ tab from the menu on your left.

Bluehost's PhpMyAdmin tool

Next, you can scroll down to the Databases section and click the ‘phpMyAdmin’ option.

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, then 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 an 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.

The post How to Fix WordPress Redirecting to Old Domain After Migration first appeared on WPBeginner.

How to Do a Full Site Redirect in WordPress (Beginner’s Guide)

Do you want to redirect your website to a new location?

A full site redirect allows you to easily move your website to a new domain without losing search engine rankings. It helps prevent broken links and provides a smooth user experience.

In this article, we’ll show you how to do a full site redirect in WordPress.

Full site redirect in WordPress

Why Do a Full Site Redirect in WordPress?

A full site redirect allows you to move your entire website to a new location without losing traffic or search engine rankings. When a user enters the old URL of your website in their browser, they will be automatically redirected to the new domain.

It also helps you keep all the backlinks you’ve built over the years and direct them to your new website domain. Your users can easily find all your existing content on the new domain.

A full site redirect also prevents broken links or 404 errors from occurring, which can be bad for your WordPress SEO and user experience.

From a technical point of view, a complete site redirect is a 301 redirect. This type of redirect tells search engines that the page has permanently moved to the new location.

This is the most beneficial type of redirect for your keyword rankings and traffic, and it helps pass the SEO authority of your old domain to the new domain.

That said, let’s see how you can set up a full site redirect in WordPress.

Editor’s Note: Before you set up a WordPress full site redirect to a new domain, it’s important that you transfer all your content first. You can use our tutorial on how to export a WordPress site, or follow our step by step guide on how to move WordPress to a new domain (without losing SEO).

How to Do a Full Site Redirect in WordPress

The easiest way to set up a full site WordPress redirect is by using the All in One SEO (AIOSEO) plugin. It’s the best SEO plugin for WordPress and is used by over 3 million professionals.

AIOSEO helps you optimize your website for search engines without the need to hire an expert. Plus, it offers a powerful redirection manager that allows you to properly redirect users to a new domain without losing SEO rankings while also tracking 404 errors.

For this tutorial, we’ll be using the AIOSEO Pro version because it includes the Redirection Manager. There is also an AIOSEO free version that has all the basic features you need to start optimizing your WordPress website to get more search engine traffic.

First, you’ll need to install and activate the AIOSEO plugin. For more details, please see our guide on how to install a WordPress plugin.

Upon activation, you can head over All in One SEO » General Settings from your WordPress dashboard and enter the license key. You can find the key in your AIOSEO account area.

Enter license key

To set up AIOSEO on your website and optimize your site for search, you can launch the setup wizard and follow the onscreen instructions. For more details, please see our guide on how to setup AIOSEO in WordPress.

Next, you can head over to All in One SEO » Redirects from the WordPress admin panel and then click the ‘Activate Redirects’ button.

Activate redirects

Once the addon is active, you can go to the ‘Full Site Redirect’ tab under Redirects.

After that, click the ‘Relocate Site’ toggle to display more options.

Enable relocate site toggle

You’ll now see a field where you can enter the new location for your website.

Simply enter the new URL in the ‘Relocate to domain’ field and click the ‘Save Changes’ button. The plugin will automatically redirect everything except the WordPress login page and admin.

Enter new domain address for relocation

To check if your redirection is working, simply enter the old URL in the browser, and it should automatically redirect you to the new domain.

Track and Fix Broken Links in WordPress

When you move to a new domain, it’s always possible that some of the links on your site could break and result in 404 errors. However, with AIOSEO, you can easily track broken links in WordPress and fix them using the redirection manager.

Simply head over to All in One SEO » Redirects from the WordPress admin area and then click the ‘Settings’ tab. Next, enable 404 Logs and Redirect Logs by clicking the toggle.

Enable 404 logs

Once you enable this feature, AIOSEO will start recording 404 errors on your website. Do note that at first, there will be nothing in the logs. It only starts recording 404 errors after you’ve enabled the option.

Once anyone has triggered a 404 error on your WordPress site, you can view the logs by going to the ‘404 Logs’ tab under Redirects.

404 logs menu option

To fix any broken link, simply click the ‘Add Redirect’ option. Then enter the new location under the ‘Target URL’ field and choose your Redirection Type.

After adding these details, simply click the ‘Add Redirect’ button.

Click the add redirect button

For more details, you can follow our guide on how to track and fix broken links in WordPress.

We hope this article helped you learn how to do a full site redirect in WordPress. You can also check out our guide on the best managed WordPress hosting and how to start an online store.

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.

The post How to Do a Full Site Redirect in WordPress (Beginner’s Guide) first appeared on WPBeginner.

How to Easily Track 404 Pages and Redirect Them in WordPress

Are you looking for an easy way to find 404 error pages on your WordPress website and redirect them?

404 errors occur when users try to reach a page on your website that no longer exists. These errors create a bad user experience, which can lead to a drop in search engine rankings and lower eCommerce sales.

In this article, we will show you how to easily track 404 pages and redirect them in WordPress.

How to Easily Track 404 Pages and Redirect Them in WordPress

What Is a 404 Error?

A 404 error is an HTTP status code that shows that the server couldn’t reach the web page you are trying to visit.

This means that if you enter a URL of a web page that does not exist, then you will see a ‘404 Page Not Found’ error.

404 Page Example

Now, there are many reasons why the 404 error occurs. It could be because the visitor made a mistake when entering the URL, the page was deleted from the website, or the domain name no longer exists.

Another cause of the 404 error is when a page was moved to another URL but wasn’t properly redirected, resulting in a broken link.

Finally, sometimes server malfunctions can also lead to 404 errors on a WordPress website.

Why Track and Redirect 404 Pages in WordPress?

Now that you know the different causes of 404 errors, let’s take a look at why it’s extremely important for website owners to track 404 errors and fix them.

404 errors are bad for your site’s user experience. If users can’t find the page they are looking for, then they will likely leave your site and go to your competitors.

This means you will lose potential customers and miss an opportunity to convert your visitors into subscribers.

Aside from that, 404 errors have a negative impact on your WordPress SEO rankings. Search engine ranking algorithms often penalize websites when they run into broken links.

Not to mention, these broken pages will cause you to lose valuable backlinks for your website, which results in lower domain authority and a significant drop in Google keyword rankings.

With that being said, let’s take a look at how you can easily track 404 pages and redirect them in WordPress. We will cover two different methods, so feel free to click the links below to jump ahead to your preferred method:

Video Tutorial

If you’d prefer written instructions, then just keep reading.

Method 1: Track & Redirect 404 Pages Using AIOSEO (Recommended)

The easiest way to track and fix 404 pages on your WordPress website is by using the All in One SEO plugin for WordPress, which is also known as AIOSEO. It’s the best SEO WordPress plugin that is used by over 3 million professionals.

AIOSEO allows you to easily find pages with broken links and fix them with just a few clicks using its powerful Redirection Manager.

The best thing about AIOSEO is that it helps you set up faster 301 redirects, which helps you improve search engine rankings.

For this tutorial, we will be using the AIOSEO Pro version because it includes the powerful Redirection Manager addon. There is a free version of AIOSEO, but it doesn’t include 404 monitoring or the Redirection Manager.

First, you will need to install and activate the AIOSEO Pro plugin. For more details, please see our step-by-step guide on how to install a WordPress plugin.

Activating Redirects and Enabling 404 Error Logs in AIOSEO

Once the plugin is active, you can go to All in One SEO » Redirects and click the ‘Activate Redirects’ button.

Activating Redirects in All in One SEO

After that, you need to visit the ‘Settings’ tab under Redirects and configure the plugin to keep 404 logs and track pages with broken links.

Simply scroll down to the ‘Logs’ sections and make sure that the ‘404 Logs’ option is enabled. Next, select the time period to record the 404 logs using the dropdown menu. We recommend no longer than one month for optimal server performance.

Enable 404 logs

Once you are done, go ahead and click the ‘Save Changes’ button.

You will now see a ‘404 Logs’ tab in the Redirects section in AIOSEO. When you first enable 404 logs, this page will not have any data because it only starts monitoring 404 pages after you enable the setting.

In time, it will show a list of all the URLs that have a 404 error. You will see how many times someone tried to visit the link in the ‘Hits’ column and the date when it was last visited in the ‘Last Accessed’ column.

Once you have identified the pages with broken links, you can simply redirect them by clicking the ‘Add Redirect’ button. You should redirect the URL to a relevant page on your website.

Click 404 logs menu option

When you click the button, you will see the option to enter a target URL and select the redirection type from the dropdown menu.

For example, you can move a page permanently by selecting the ‘301 Moved Permanently’ option.

Add redirect

After that, click the ‘Add Redirect’ button, and your broken link will now automatically redirect to the new target URL.

Clearing 404 Error Logs in AIOSEO

With time, the size of your log file can grow and take up a lot of disk space. A lack of WordPress hosting disk space can lead to errors. To make sure that you don’t run into this problem, it’s a best practice to delete and clear 404 error logs.

With AIOSEO, you can easily delete any individual 404 error from your logs by clicking the trash can icon.

Delete 404 error log entry from AIOSEO

You can also bulk delete your 404 logs by going to All in One SEO » Tools and then clicking on the ‘Database Tools’ tab.

Now, just scroll down to the ‘Logs’ section and click the ‘Clear 404 Logs’ button.

Clear 404 logs from database tools

Permalink Monitoring in AIOSEO

Aside from tracking 404 errors, the AIOSEO Redirect Manager also comes with permalink monitoring. This means that if you delete a page on your site, or change the URL of any blog post, then AIOSEO will automatically notify you to set up a redirect.

In some cases, AIOSEO can even set up the proper 301 redirects for you without any effort.

Bonus Tip: Set Up Faster 301 Redirects in WordPress With AIOSEO

AIOSEO also allows you to set up faster redirects by going to the ‘Settings’ tab and choosing the ‘Web Server’ redirect method.

AIOSEO Server Level Redirects

This allows you to unlock significant speed improvements when compared to the default WordPress/PHP redirect method.

Method 2: Track & Redirect 404 Pages Using the Redirection Plugin

The next method to track and redirect 404 errors is by using the free Redirection Plugin for WordPress. This is an advanced plugin, so some beginners may find it harder to use.

First, you need to install and activate the plugin. For more details, please see our step-by-step guide on how to install a WordPress plugin.

Upon activation, go to Tools » Redirection and then scroll down and click the ‘Start Setup’ button to set up your redirects.

Start setup of Redirection plugin

After that, the plugin will ask whether you would like to monitor permalink changes in WordPress and keep logs of redirects and 404 errors.

Just select the checkbox for these options and click the ‘Continue Setup’ button.

Basic setup Redirection plugin

The plugin will now test the REST API status.

When the status result comes back as ‘Good’, you can click the ‘Finish Setup’ button.

Rest API test in Redirection

After that, the plugin will set up redirection. This will take several seconds, and when it is complete, you will need to click the ‘Continue’ button and then the ‘Ready to begin!’ button.

Now, you can start to redirect your 404 pages.

Simply enter the URL of the page you want to redirect in the ‘Source URL’ column.

Next, select whether you’d like to exactly match the query parameters, ignore them, or pass them through to the target URL from the ‘Query Parameter’ dropdown menu.

Now, you need to enter the Target URL to where the 404 page will be redirected, keep the Group option as ‘Redirection’, and click the ‘Add Redirect’ button.

Add new redirection

If you want more options to set up redirection, then just click the gear icon next to the ‘Add Redirect’ button.

You can begin by adding the old URL showing 404 in the ‘Source URL’ field, selecting the Query Parameter like before, and adding a title to describe the purpose of this redirect.

After that, select the ‘Match’ option from the dropdown. You will see multiple options, including URL only, URL and referrer, URL and user agent, and URL and login status.

More options for add new redirection

In most cases, you want to use the ‘URL and referrer’ setting. That’s because if you see several 404 requests for a specific page, then those users probably clicked on the same link to the wrong URL rather than all typing the same wrong web address.

Now, whenever someone else clicks on the broken URL, it will automatically redirect them to the new location.

Next, make sure that your action is ‘Redirect to URL’. The other options are complex and require advanced technical knowledge.

For the redirection type, you need to select an option from the HTTP code dropdown. For a permanent redirection, this should be ‘301 – Moved Permanently’.

Lastly, enter the target URL in the ‘Matched Target’ field. After you have entered this information, just hit the ‘Add Redirect’ button.

You can go to the new URL to test and make sure that the redirection is working properly.

The plugin also has the option to track 404 error logs. Simply click on the ‘404s’ tab at the top, and the plugin will show you recent 404 errors that occurred on your site since you installed the plugin.

404 Logs in Redirection plugin

Note: If you just enabled the Redirection plugin, then the 404 log page will be empty. It only starts keeping a log of 404 errors after the plugin is activated.

Bonus: Design a Custom 404 Page With SeedProd

Setting up redirects means that visitors shouldn’t run into many 404 error pages on your WordPress website. However, if they do land on a 404 page, it’s a good idea to have a custom design that will help out your users.

Including your custom branding can make your 404 page look more reputable. Adding a contact form can allow users to tell you the address they entered that triggered the 404 error. You can even include links to your popular posts or products so that visitors will be tempted to stay on your website.

Luckily, it’s easy to design a custom 404 page with SeedProd. It’s the best WordPress landing page builder and comes with plenty of customizable templates for 404 pages.

Building a custom 404 page for your WordPress website

You can learn more in our complete guide on how to improve your 404 page template in WordPress.

We hope this article helped you learn how to track 404 pages and redirect them in WordPress. You may also want to see our guide on how to increase your blog traffic the easy way or our expert picks of the best 404 error page examples to inspire your website design.

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.

The post How to Easily Track 404 Pages and Redirect Them in WordPress first appeared on WPBeginner.