Transfer a WordPress site from one domain to another without losing SEO position

Transfer a WordPress site from one domain to another can make you lose your SEO position if you do not follow the steps indicated in this article.
transfer website from one domain to another

There are various reasons why there may arise the need to change the domain of your website after it has already been created, and after you have already installed WordPress.

Magari, dopo aver avviato un progetto con un certo nome, ad esempio ilmionegozio123.com hai deciso di cambiare nome in ilmionegozioABC.com, oppure il tuo responsabile Web Marketing ti ha suggerito di spostare il sito sul dominio ilmionegozio123.it che “fa made in Italy” e per il tuo prodotto è più adatto.

Qualunque sia il motivo per cui hai deciso di cambiare il dominio del tuo sito web, tra trasferire il tuo sito senza prendere nessuna accortezza e trasferire il tuo sito WordPress SENZA perdere posizione SEO, c’è un mare di differenza.

Indeed in many cases this process is not carried out correctly, which can lead to a permanent deletion of months or years of work devoted to optimizing the website from an SEO perspective.

Before even delving into this topic, however, it is important to take a step back and clarify the meaning of the domain itself, which might be less obvious than you think and cause confusion if misunderstood.

What is the “domain” of a website?

A domain or domain name is the alphanumerical name with which it is possible to access the server on which your website is present. If for finding a residence one refers to the house number, on the web the user can access the information they need (for example, those present on a site) using the domain name.

For example you might have created your website on: https://www.ilmionegozio123.com

In such a case your domain will be: ilmionegozio123.com while .com is the TLD (top-level domain), there are various types including .it (which is the Italian extension).

Now that you know for certain the meaning of domain, we can go back to the main question, namely:

Why transferring a WordPress site or changing domains may hurt my SEO?

Changing domain, or generally transferring your domain to another address, can lead to very unpleasant consequences, such as partial loss of PageRank or even the total loss of your website’s positioning.

This translates into a jump back in time for your availability on Google, and can ruin (if not destroy) the work of your Web Marketer or the positioning work you have done years during the life of your website.

The PageRank of Google is a score that serves to indicate the popularity of an indexed web page (which is identified by its domain), and -in fact- this score establishes whether a website appears before or after others, and as you surely know, only the very first websites that appear on Google are clicked, even less than 8% of people searching for something go to check the second page.

You will therefore understand that appearing on the first page of Google and not compromising the work you have done so far to appear on the first page should not be jeopardized by the operation you have now decided to perform, namely transferring your WordPress website from one domain to another.

Try Hosting4Agency on a site of your choice for 30 days and compare the performance before/after the trial period!

How do you change a domain on a WordPress site?

Chiameremo per semplicità il tuo dominio attuale dominio primario (ilmionegozio123.com) ed il nuovo dominio nel quale vuoi spostare il tuo sito web dominio secondario (ilmionegozioABC.com).

Innanzitutto, questa operazione si suddivide in 5 passaggi:

  1. register or transfer the secondary domain. To do this you can:
    • register or transfer the new domain name (secondary domain) with the same provider where you already have your current website
    • alternatively, make sure you have control of the DNS of your secondary domain: you will need it later
  2. Point the secondary domain’s DNS to the same server as the primary domain
  3. Explain/notify WordPress of this change, modifying the table wp_options
  4. Update all URLs present on the WordPress site to appear on the secondary domain
  5. Create 301 redirects from the primary domain to the secondary domain and notify Google

Done!
Your old domain is now a secondary domain, and the new one will be the primary domain from now on.

Analyze all these steps in detail:

1. Register or transfer the secondary domain

Register or transfer the new domain name (secondary domain) to the same provider where you already have your current website.

Alternatively, make sure you have control of the DNS of your secondary domain: you will need it later.

2. Point the secondary domain’s DNS on the same server as the primary domain

Subsequently to make the software work on the new secondary domain, you will need to ensure that the domain’s DNS points to the same server as the primary.

For this, you can copy entirely the old DNS or, if you prefer, you can modify only the main records making sure that the secondary domain IP address is equal to that of the primary address.

To do this, you can open a terminal and write: ping ilmionegozio123.com. Afterwards, you will need to copy and paste the IP address (for example 8.8.8.8) replacing it with the one you find in the just registered secondary domain.

3. Notify WordPress of this change by modifying the table wp_options

Yes, indeed, WordPress does not work transparently on any domain, but it needs to know the URL of the domain where it should function, to be able to work.

Additionally, unfortunately this information is contained -by default- in the database and not in the basic WordPress configuration file.

To modify this information, you will need to change 2 values contained in the database, using phpMyAdmin (a tool present in most hosting providers), entering into the database where you installed WordPress and going into the wp_options table (it might also be called XYZ_options if you changed table_prefix).

Then click 2 times on the primary domain value: https://www.ilmionegozio123.com
and insert the secondary domain inside: https://www.ilmionegozioABC.com

Remember to make this change for “home” as well as for “siteurl”.

Alternative you can also modify these 2 values in the wp-config.php file (more straightforward) via FTP. You just need to edit the file and add (or modify) the values:

define( ‘WP_HOME’, ‘https://www.ilmionegozioABC.com’ );

define( ‘WP_SITEURL’, ‘https://www.ilmionegozioABC.com’ );

4. Update all URLs present on the WordPress site to appear on the secondary domain

At this point, if you have correctly modified the DNS and they have propagated as indicated in step 2, and if you have changed the values as indicated in step 3, you can directly enter the backend of your website on the secondary domain: https://www.ilmionegozioABC.com/wp-admin/

What has factually already become his primary domain.

A first consideration to take at this stage is to modify all the URLs within your website, while -at the moment- we have only modified the main URLs necessary for its functioning, there could be many incorrect links within the website.

To fix them, we will use a famous plugin: Better Search and Replace

Basta cliccare nel menu:

Plugin > Add New > Search > Better Search and Replace

Download and Activate the plugin.

Now that it is active, just click in the menu:

Tools > Better Search and Replace

Cerca per: ilmionegozio123.com
Sostituisci con: ilmionegozioABC.com

Select the tables: select all using the mouse.

You want to do only a test? disable it!

Click finally Execute Find/Replace and wait.

Finished! At this point all URLs of type old: are replaced with the new links:

Now you can safely deactivate and delete the plugin: it will not be needed anymore.

5. Create 301 redirects from the primary domain to the secondary domain and notify Google

And now the most important thing.

While the previous steps were purely technical and necessary to achieve the goal of transferring a WordPress website from one domain to another, now we will see how not to lose your Google PageRank.

It is necessary first to create a 301 redirect from the old domain (which was initially primary but now we can call secondary), towards your final domain, which is now the primary domain.

The way to do it depends on your hosting service provider. Some do it directly from the Control Panel, in other cases you might have to do it from the software (uploading an HTML file), or WordPress can handle it directly.

It is for this reason that we suggest installing another useful plugin: Redirection.

Basta cliccare nel menu:

Plugin > Add New > Search > Redirection
(by John Godley)

Download and Activate the plugin.

Now that it is active, just click in the menu:

Tools > Redirection

Suggest setting it up with:
log errors 404
for 30 days but with no IP log (because this type of tracking can slow down the website).

From now on, all 404 errors that your website generates can be handled by this plugin creating a simple 301 redirect, so sending the user to another page or file, and telling Google where the content has been moved.

Here’s why we perform this important operation: telling Google that the old content which it had indexed/PageRank has been moved.

This will not only prevent you from losing PageRank for your entire domain/site, but also allow you to remap, if desired, the main URLs to suit the new structure that your website might have.

And now? You could wait for Google to discover the change on its own, or you could notify it and in this way ensure that you do not lose PageRank, following these instructions.

In practice, if you already had the Webmaster Tools active for this site (otherwise bad, always activate them for your sites where you want to care about SEO) you need to go to:

Search Console > Your profile settings > Change of address > follow the instructions to change it

In this way instead of losing time and risking that Google does not understand what you have done, you will immediately inform it of having changed domain and that your new domain is not a completely new website.

Change domain of a WordPress site: Summary

If you have followed all the steps listed with precision, you should not have any type of problem. We hope we have helped you learn everything there is to know for moving a WordPress website from one domain to another without losing SEO position.

Please don’t underestimate this operation and check after doing it to make sure you haven’t lost PageRank: use only professional tools or rely on professionals.

If you think that this type of operation is too delicate for your current skills or you do not have enough time to deal with it, don’t worry! In this case, turning to an expert team can really help you to free yourself from any concerns.

If you are looking for a really reliable team able to keep your sites always protected, fast and up-to-date and handle for you every type of operation and technical issue, take a look at the advantages of our services and start your free trial period.

Continue reading

Share on:

Related Articles

Stop being the troubleshooter. Discover how managed hosting transforms your web agency's servers into recurring revenue with 100% green infrastructure.
Hosting4Agency launches the bilingual site! Discover how to automate translations for web agencies with AI generative, 100% green servers and WPML license included. Zero token costs.
Discover how 100% green enterprise hosting guarantees performance, reduces TCO and supports your company's ESG compliance (Scope 3, GDPR, NIS2).

Contact us

If you want to speak with a team member or, if they have any doubts, do not hesitate to contact us.
Alternatively try to consult our FAQ section.