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

Så här flyttar du enkelt WordPress till en new domän (utan att förlora sökmotorsoptimering)

Att flytta din WordPress-webbplats till en ny domän är ett stort steg som kräver noggrann planering. Att ändra ditt domännamn kan påverka din SEO-rankning, så det är viktigt att hantera processen med omsorg.

Även om tillfälliga SEO-fluktuationer är oundvikliga under en domänmigrering kan du minska påverkan. Med rätt tillvägagångssätt kan du snabbt återfå din söktrafik och ranking.

I den här guiden går vi igenom det korrekta sättet att flytta WordPress till en ny domän utan att förlora SEO.

Migrating a WordPress website to a new domain name without loosing SEO

Att flytta din WordPress site till ett nytt domain name kan vara skrämmande, men det behöver det inte vara. Vi finns här för att hjälpa you genom varje steg i processen.

Du kan klicka på någon av länkarna under för att gå till ett visst steg i flyttningen av din WordPress site till ett nytt domain name:

Video Tutorial

Subscribe to WPBeginner

Om du föredrar skriftliga instruktioner är det bara att fortsätta läsa.

Vad du bör veta innan du byter domäner

Innan du börjar är det några saker du bör känna till.

Processen att överföra till en ny domän kommer tillfälligt att påverka din ranking hos sökmotorer eftersom Google och andra search engines måste anpassa sig till förändringarna.

Det kommer också att tillfälligt påverka din söktrafik. Tänk på att detta är normalt, och att det händer alla webbplatser som byter till en ny domän.

Du kan dock dramatiskt minska sökmotorsoptimeringen genom att följa den här guiden. Vi kommer att visa dig hur du flyttar din WordPress site till ett nytt domain name, ställer in korrekta 301 redirects och meddelar search engines.

Vänligen notera att denna guide ej är till för att flytta en WordPress site till en new server. Detta är endast för att byta ett domain name. Även om processen är likartad finns det några extra steg. Dessa extra steg hjälper dig att skydda din sökmotorsoptimering och trafik.

Slutligen, om din gamla website finns på WordPress.com, måste du följa instruktionerna i vår guide om hur du flyttar från WordPress.com till WordPress.org istället.

Förberedande steg: Vad du behöver för att komma igång

I den här guiden antar vi att du har din WordPress-webbplats konfigurerad på oldsite.com och att du försöker migrera den till newsite.com.

Vi förutsätter också att du redan har ett konto på ett WordPress webbhotell och att du är bekant med kontrollpanelen på ditt webbhotell.

Du måste också veta hur man använder en FTP-klient som FileZilla eller hur man redigerar filer med appen File Manager som finns tillgänglig i adminpanelen på ditt webbhotell.

Om du inte har en hosting provider eller vill byta till en new, rekommenderar vi att du använder Bluehost (bra för små webbplatser + kommer med en gratis domän) och antingen SiteGround eller WP Engine (bra för större webbplatser eller online stores).

När du har dessa saker på plats är du redo att starta processen!

Step 1: Skapa ett Duplicator-paket av din WordPress-webbplats

Det första du behöver göra är att skapa en fullständig backup av din WordPress site.

You’ll then use this backup to create a duplicate of your website so that you can set up the redirects properly from your old domain to the new one.

Det finns många WordPress-backup-plugins tillgängliga, men vi kommer att använda Duplicator för denna handledning.

Duplicator är det bästa plugin-programmet för säkerhetskopiering och migrering av WordPress. Vi har använt det för att migrera otaliga webbplatser för våra egna företag såväl som för kunder. Vi har funnit att det fungerar pålitligt, även för mycket stora webbplatser.

Obs: Det finns också en gratisversion av Duplicator som du kan använda för den här migreringen. Vi rekommenderar dock att du uppgraderar till en betald plan för att låsa upp fler funktioner som automatiska molnbackuper, 1-klicks webbplatsåterställning, enklare migreringar och mer.

Låt oss börja med att installera och aktivera pluginet Duplicator på ditt gamla domain name. För mer detaljer, se vår Step-by-Step guide om hur man installerar ett plugin för WordPress.

När pluginet har aktiverats kommer det att add to ett Duplicator menu item i din WordPress admin. Du måste klicka på Duplicator-menyn och sedan klicka på knappen ”Skapa ny” för att skapa ett nytt paket eller en kopia av din WordPress-webbplats.

Create a new Duplicator package

Duplicator kommer nu att initiera back wizard den kommer automatiskt att tilldela ett namn till detta paket.

Klicka på knappen ”Nästa” för att fortsätta.

Duplicator package name

Duplicator kommer nu att köra några tester för att se om allt är i order. Om tillägget hittar en issue kommer du att se en varning med instruktioner.

Om alla objekt är markerade med ”Bra” klickar du på knappen ”Bygg”.

Duplicator build package

Pluginet kommer nu att börja skapa ett dupliceringspaket av dina webbplatsfiler. Beroende på storleken på din webbplats kan den här processen ta några minuter.

När du är slutförd ser du ett alternativ för ”Download”. Click it will show you alternatives to download Both Files or download Installer and Archive (zip) separately.

Duplicator download both files

Välj ”Both Files” för att downloada dem till din dator.

Archive-filen är en komplett kopia av dina WordPress-filer. Den innehåller dina WordPress themes, permalänk settings, plugins, uppladdare och alla andra filer som skapas av WordPress plugins.

Skriptet för att installera är en PHP-fil som automatiserar och run migreringen av WordPress genom att packa upp archive-filen.

Step-by-Step 2: Skapa en Database för ditt nya Domain Name

Innan du flyttar din WordPress site till den nya domänen behöver du en ny SQL database för att packa upp WordPress på ditt nya domain name.

Om du redan har skapat en database kan du hoppa över detta steg.

För att skapa en database måste du besöka ditt webbhotells kontos cPanel dashboard, rulla ner till ”Databases” section och sedan click på ”MySQL Databases” icon.

Vi kommer att visa dig hur du hittar den på Bluehost, men de grundläggande instruktionerna är desamma och bör gälla för alla hosting providers.

Logga in på instrumentpanelen för ditt Bluehost-konto och klicka på knappen ”Settings” under din website.

Bluehost site settings

Under your site settings måste du växla till tabben ”Advanced”.

Rulla ner lite till cPanel section och click ”Hantera”.

Bluehost cPanel

Detta öppnar dashboard för cPanel.

Rulla ner till sektionen Databases och klicka på alternativet ”MySQL Databases”.

Bluehost cPanel MySQL Databases

Note: Din kontrollpanel för webbhotell kan se något annorlunda ut än screenshots. Du bör dock fortfarande kunna hitta en Database section med ett alternativ för att skapa en new database.

Ange bara ett namn på din database och klicka sedan på knappen ”Create Database”.

Bluehost cPanel create MySQL database

cPanel kommer nu att skapa en new database åt you. Efter det måste du rulla ner till MySQL Users section.

Ange sedan ett användarnamn och ett password för din nya användare och click på knappen ”Create User”. Se till att obs/observera användarnamnet och passwordet på en säker plats.

Bluehost cPanel add MySQL database username and password

Den nya användaren som you just skapade har fortfarande ej behörighet att arbeta i databasen. Låt oss ändra på det.

Rulla ner till section ”Add User to Database”. Först väljer du den användare av databasen som du skapade i dropdown-menyn bredvid fältet ”User”. Välj sedan den new database som du just har skapat och click på knappen ”Add”.

Bluehost cPanel Add user to database

Därefter kommer du att bli ombedd att välja behörigheter för användaren.

Välj ”All Privileges” och klicka på knappen ”Make Changes” för att fortsätta.

Bluehost cPanel MySQL database user privileges

Din database är nu klar och kan användas för att flytta WordPress till det nya domain name.

Se till att du obs/observerar databasens namn, användarnamn och password. Du kommer att behöva denna information i nästa steg.

Step-by-Step 3: Packa upp WordPress på ditt nya domain name

Nu måste du uploada Duplicator-filerna som du downloadade tidigare till ditt nya domain name.

I Duplicator-paketet ingår även din installation av WordPress. Det innebär att du inte behöver installera WordPress på din new domän.

Anslut först till ditt domain name med hjälp av en FTP-klient. När du är ansluten ska du se till att rotkatalogen på din website är helt tom.

Efter det kan du uploada filerna archive och installer till root directory. Denna anropas vanligtvis public_html.

Upload Duplicator files to new domain name

När båda filerna har slutförts att uppladdas är du nu redo att packa upp WordPress.

Öppna en new tab i webbläsaren och gå till följande URL:

http://example.com/installer.php

Glöm inte att ersätta example.com med ditt new domain name. Detta kommer att starta migreringsguiden för Duplicator.

Duplicator installer wizard

Installatören kommer att leta efter archive-filen och sedan automatiskt välja alternativ för dig på skärmen.

Rulla ner lite för att enter informationen för den database you skapade i föregående steg.

Duplicator add database info

Under det kommer Duplicator automatiskt att visa dig URL: en för din gamla domän och din nya domän.

Om allt ser bra ut klickar du på knappen ”Bekräfta” för att fortsätta.

Duplicator validate details

Duplicator kommer nu att försöka ansluta till databasen med hjälp av den information you providerade.

Utan problem kommer du att få en bekräftelse. Annars visas en varning med detaljer om hur du fixar det.

Duplicator validation passed

Klicka på knappen ”Nästa” för att fortsätta.

Duplicator kommer nu att börja importera din WordPress website. När det är slutfört kommer du att se ett success message med en knapp för Admin Login.

Duplicator migration finished

Duplicator kommer automatiskt att update URL:er till ditt new domain name. Du kan nu klicka på knappen ”Admin Login” för att slutföra nästa steg.

Step-by-Step 4: Ställ in permanenta 301 redirects

Nästa steg är att peka användare som anländer till ditt gamla domain name till den nya domänen. Detta görs genom att konfigurera 301 redirects.

301 redirects är mycket viktiga för sökmotorsoptimering och för användarnas upplevelse. Adding them will allow you to automatically redirect users and search engines to your new domain name.

Med andra ord, när någon landar på ett post eller en page på din gamla domän, kommer de automatiskt att redirectas till samma post eller page på din new domän istället för att se ett 404 error.

För att hålla dina omdirigeringar på plats måste du hålla din gamla WordPress-installation aktiv så att den kan fortsätta att redirecta till den new som du just har skapat.

Det finns två sätt att konfigurera redirects. Den första metoden är enkel och tar bara några click. Den andra metoden är obligatorisk för att du ska kunna editera filer manuellt.

Metod 1: Ställ in 301 Redirects med All in One SEO

För den här metoden behöver du All in One SEO (AIOSEO). Det är det bästa WordPress SEO-tillägget på marknaden och allow you att enkelt optimera din WordPress website för SEO.

Först måste du installera och aktivera pluginet All in One SEO på din gamla domän. För mer detaljer, se vår Step-by-Step guide om hur du installerar ett plugin för WordPress.

Note: Du behöver minst Pro-versionen av pluginet för att få tillgång till redirect manager addon. Du kan också konfigurera AIOSEO på din new WordPress site för att öka din search engine ranking och trafik ännu mer.

Efter aktivering på din gamla domän måste du besöka All in One SEO ” Redirects page och klicka på knappen ’Activate Redirects ’.

Activate redirects

Därefter måste du byta till tabben ”Full Omdirigera webbplats” och slå på ”Flytta webbplats” toggle.

Efter det måste du enter ditt nya domain name bredvid alternativet ”Relocate to domain”.

Full site redirect

Glöm inte att klicka på knappen ”Save Changes” för att spara dina inställningar.

Metod 2: Ställ in manuellt Redirects till ny domän

Denna metod kräver att du redigerar WordPress .htaccess-filen på ditt gamla domain name.

Först måste du ansluta till din gamla site med FTP och editera .htaccess-filen.

This will be located in the same directory as your wp-includes or wp-admin folder. Öppna .htaccess-filen och klistra in följande rader med kod högst upp:

#Options +FollowSymLinks
RewriteEngine on
Unchanged: RewriteRule ^(.*)$ http://www.newsite.com/$1 [R=301,L]

Se till att du ersätter newsite.com med din new domän i koden ovan.

När du har tillämpat dessa ändringar besöker du ditt gamla domain name. Den ska automatiskt redirecta you till den new domänen.

Om den inte gör det betyder det att redirecten inte är korrekt konfigurerad och att din server troligen inte har support för redirect-regler. You need to contact the support team at your web hosting company to get RewriteEngine turned on.

Step-by-Step 5: Meddela Google om din nya domän

Nu när du har flyttat WordPress till ett nytt domain name och ställt in redirects är det dags att meddela Google om din adressändring. Detta kommer att hjälpa Google att hitta din new website domän snabbt och börja visa den i sökresultaten.

Först måste du se till att både dina nya och gamla domäner läggs till i Google Search Console som två olika egenskaper. Se steg 1 i vår guide till Google Search Console för instruktioner.

Därefter måste du välja det gamla domain name som den aktiva egenskapen i din Google Search Console-kontos dashpanel.

Select old domain

Därefter klickar du på menyn Settings i den vänstra columnen.

Nu kan du klicka på verktyget ”Change of address”.

Change of Address

Nu måste du välja din nya domän från Update Google section.

Sedan ska du klicka på knappen ”Validate & Update”.

Add new address to change of address

Det är all. Google kommer nu att bekräfta att din gamla domän redirectar till den new domänen och save dina ändringar.

På nästa vy visar Google Search Console dig en Step-by-Step Wizard för att skicka in din request om adressändring.

Meddela dina användare om det nya domain name

Medan 301 redirects gör sitt jobb är det alltid bra att göra ett offentligt tillkännagivande om flytten.

Du kan göra detta genom att helt enkelt skriva ett blogginlägg om din new site och dela det på dina konton på social media.

Om du har prenumeranternyhetsbrev via e-post eller push notifications bör du skicka ut ett meddelande till dem också.

Detta kan vara till hjälp på många sätt.

Först och främst är det mer troligt att dina användare gillar att komma ihåg den nya domänen när de har läst om den.

För det andra kan du be dina användare att meddela dig om de ser några buggar. Du kan inte ensam testa din webbplats i alla typer av webbläsare eller systemmiljöer, så det är alltid bra att låta ett par nya ögon titta på den.

Bonusresurser

Följande artiklar och handledningar hjälper dig att spåra och återfå din SEO-ranking efter att du har flyttat till ett nytt domännamn:

Vi hoppas att denna handledning hjälpte dig att flytta din WordPress-webbplats till ett nytt domännamn. Du kanske också vill se vår guide om hur du får en gratis e-postdomän eller följa stegen i vår kompletta SEO-guide för WordPress.

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.

Avslöjande: Vårt innehåll stöds av våra läsare. Det innebär att om du klickar på några av våra länkar, kan vi tjäna en provision. Se hur WPBeginner finansieras, varför det är viktigt, och hur du kan stödja oss. Här är vår editoriala process.

Avatar

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.

Den ultimata WordPress-verktygslådan

Få GRATIS tillgång till vår verktygslåda - en samling WordPress-relaterade produkter och resurser som varje professionell användare bör ha!

Reader Interactions

508 kommentarerLämna ett svar

  1. Syed Balkhi

    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!

  2. Babs

    This absolutely worked for me :)

  3. Eben

    Hi, One simple question,

    Domain1.com (expired but files are there in CPanel of X Hosting)
    Domain2.com (new domain added to X Hosting and nameservers updated to point to hosting server)

    I simply want my Domain2.com to point to files or folder of Domain1.com in my hosting account

    pls tell how to do this..this is not answered clearly anywhere

    • WPBeginner Support

      Hi Eben,

      In your domain settings there is an option to select the root folder or home directory for that domain. You can use that option and point it to the directory that has your older domain’s files.

      Administratör

  4. Rafi

    Hi there,
    My website domain name has expired but I have a full backup of it using backup to dropbox. Now can I migrate the previous site to a new domain? If possible then what are the process?
    Thanks In Advance
    Rafi

    • WPBeginner Support

      Hi Rafi,

      Yes you can migrate it to a new domain name. The process actually depends on the backup you have. If you have complete WordPress backup then you can just upload it to your new domain name and then update URLs.

      Administratör

  5. sarah

    I enjoyed the article! I just wondered, what do i do if my new site is still being hosted with wordpress? there is no URL change either.
    I don’t think i’ll need to do any 301 redirects is that right?

    However, I am lost as to the steps i should take to move the traffic from A to B, does this depend on the DNS change? Would appreciate any advice!

  6. Logan Miller

    This is SUCH a helpful article.
    I’m currently stuck at the ”sitename.com/installer.php” step. When I put this in the browser (but with my actual domain) I get a 404 error.
    The installer.php file is uploaded to my directory, so in theory it should work?

    I’ve double checked all the previous steps, and it seems to all be good, so I’m stuck.

    My first thought is that perhaps the dns nameservers haven’t fully propagated yet, and I’m being impatient.

    Anyone have an idea?

  7. Chris

    Hey guys great article. I actually merged 2 existing sites together and moved all the content from my subdomain site onto my main domain site.

    All data has been transferred across and I have setup the redirect using htaccess file. All the links appear to be redirecting correctly =)

    my question is, what should I do with the OLD wordpress install (files, database etc) located on the subdomain?

  8. Julie

    Great article! My question is similar but my client already has a new site hosted with blue host. Her old site is a wordpress.com site. She doesn’t need any of the content as she has completely finished the new site. My question is about the redirects from the old site. People still visit there and she’s got good rankings. What’s the best way to redirect the pages (urls) from her old wordpress.com site to her new self hosted site? No content or anything. Just the redirects.
    Thanks for all your help! You guys are the best!!

    • WPBeginner Support

      Hi Julie,

      The best way to redirect is by purchasing the Site Redirect addon from WordPress.com

      Administratör

  9. Shadhirsha

    Hi,
    I have a website with subdomain and I didn’t publish my main domain. when I trying to apply for adsense. it shows that you can’t register with subdomain.
    So I am trying to move my subdomain to main domain. But I have problems

    These are the problems below:
    1. I have register google analytics, google optimize, tag manager and webmasters and etc(SEOs) with subdomain
    2.Traffics and trackings

    So, Please help me to move my website safely

    • WPBeginner Support

      Hi Shadhrisha,

      Please see our article on moving WordPress from subdomain to root domain.

      You will need to create a new Google Analytics, Optimize, and Tag manager profile for the root domain as it is a different domain altogether. Same goes for webmaster tools, however you can inform Google by change of address in the webmaster tools settings for your old subdomain.

      Administratör

  10. Brian

    I had an idea for a website and instead of registering for a domain i just made a subdomain from one of my other sites. The idea has developed into something more now. I want to register a domain name and move everything to it and delete the subdomain. I don’t have that much content, I haven’t started it up yet. I could just delete the subdomain and populate the new domain manually. But I do have the subdomain in google analytics and search console. Would it hurt my new site if I did just delete the subdomain, register a new domain and start from there.

    • WPBeginner Support

      Hi Brian,

      If the site was not indexed by search engines or had no significant content, then it is safe to delete it.

      Administratör

  11. Mike Poepping

    This article makes sense for how to move an entire domain to a new address, but what would change in this process if I only wanted to move some content from one site to another?

    I’m working with a client who has a new site being developed (for a large national audience), so that their current site can focus on driving local leads only.

    I want to know how to get their highest performing blogs on to the new national site without losing the excellent keyword rankings we’ve achieved over the past couple of years on their current site (which is the site moving to the extremely local focus).

    Any tips and/or guidance would be greatly appreciated, thanks in advance!

  12. Sam

    unfortunately, I deleted all the old domain files including the .htacess file from the server without redirecting.Now I got my new domain and I don’t have my old domain files. could you please tell how can I redirect the users from old to the new domain in this situation? Else my domain will be penalized by Google which looks like duplication as I didn’t redirect.

    • WPBeginner Support

      Hi Sam,

      Assuming that you still have the old domain name registered, deleting the file only makes your website unavailable on your old domain. You can simply create a new .htaccess file in the old domain folder to set up redirects.

      Administratör

  13. Murali N

    Hi, my current WordPress is in root folder; now I want to create WordPress Network / Multisite with sub-folders.
    Can I move my current example.com to example.com/subfolder-1 following the above? OR, is there a simple way to do this?

  14. Alex

    Hi

    I want move a website to another domain however the structure is very different. The old website was created several years and hasn’t even submitted to google webmaster or console as it is now. What would be the best way to go around it.

  15. Joe G

    There are about a million unanswered questions that all ask the same thing:

    How long do you leave the old site up for?

    If you delete the old site files (to save backup space) will leave the edited .htaccess file in the old directory, will it continue to forward to the new site?

    Thanks.

    • WPBeginner Support

      Hi Joe,

      You should keep your old domain for at least 6 months. You can delete any old files via FTP without deleting .htaccess file.

      Administratör

  16. Abhay

    Hi,

    Thanks a lot for your post!

    I am using a domain abcd.com for my WordPress based website hosted on Bluehost and want to shift to wxyz.com. I have purchased this new domain.

    Now your article says ”Next, you need to open your FTP program and connect to your new site. Make sure that the root directory, or the directory where you want to copy your website is completely empty. Upload the installer.php file and your package zip file to the new site.”

    What do you mean by ”connect to new site”? As far as I read from your website, and FTP client is used to access files on your ’hosting’ and not ’domain’. How do I access the root directory of my new domain? I just have the domain name with me.

    I am not a pro with the website stuff so I contacted my domain provider, they said you can simply change the A name record and nameservers.

    I am stuck, please help me.

    • WPBeginner Support

      Hi Abhay,

      Domain names are addresses that point to files hosted on your hosting account. Please see our guide on the difference between domain names and web hosting to learn more.

      If your new domain is also hosted on Bluehost, then you can go to your domains settings and find out your root folder. It could be any folder inside your website’s root directory. Usually it is named after your domain name.

      Administratör

      • Abhay

        Hi,

        I am using the following service providers:

        Hosting: Bluehost
        Old Domain: Hostgator
        New Domain: Godaddy

        Now how to I access the root folder of my new domain?

        • WPBeginner Support

          Hi Abhay,

          First you will need to point your GoDaddy domain to Bluehost servers by changing its DNS settings. Next you will need to add your domain name to your Bluehost hosting account. Go to your hosting cPanel dashboard and click on Add Domains.

  17. Rob

    Hi!! Thanks for this!!

    I have a question though: Do I need to keep my old domain like forever? Until when should I wait to finally delete my old domain?

    • WPBeginner Support

      Hi Rob,

      We recommend keeping the old domain for at least 6 months. After that you can let it expire.

      Administratör

  18. Krunal

    Hi, I am trying to shift a blog between two domain hosted on the same server and with the same MySQL server versions. However while installing database i am getting a connection error and and reason mention in the message was the MySQL Version issue. Below is the exact message i am getting:

    NOTICE: The current version detected was released prior to MySQL 5.5.3 which had a release date of April 8th 2010. WordPress 4.2 included support for utf8mb4 which is only supported in MySQL server 5.5.3+. It is highly recommended to upgrade your version of MySQL server on this server to be more compatible with recent releases of WordPress and avoid issues with install errors.

    Any help in this regards is really appreciated.

    Thanks

    • WPBeginner Support

      Hi Krunal,

      Please ask your WordPress hosting provider to upgrade your MySQL version.

      Administratör

  19. Joe G

    Everything worked perfectly with the move but what now?

    How long do you need to keep the old installation and will the redirect still work with just the edited .htaccess in the directory?

  20. Andreas Schueler

    Very helpful post, thank you. With your help, moving to the new domain was a breeze.

  21. Smith Andrews

    Firstly, thank for your great work….i want to migrate my site to a new domain in the same server…the old domain is in the public directory so will the new site be a subdomain or what im confused??

    • WPBeginner Support

      Hi Smith,

      You can point your domain name to any folder inside public_html. For example, you can create a new folder under public_html and name it after your new-domain.

      Administratör

  22. Adesanmi Franklyn

    Hi,
    Thanks for this awesome content. Please I want to know how long it will take Google to rank the new site as the old site. And also, would all the link juice of the old site be passed to the new site?
    Because the moment I changed the URL following this all traffic and post ranks drop. Now I’m wondering if it will take position again on search.

    • WPBeginner Support

      Hi Adesanmi,

      Please see the step 4. It allows you to tell Google that your website address has changed. The search rankings will start reappearing in sometime. Meanwhile, your 301 redirects will keep sending users to your new website.

      Administratör

  23. Tanya

    Thanks for this detailed post. I’m wondering why I need to duplicate the wordpress site. Why can’t I just change the domain for the current site without duplicating it? If I create a duplicate wordpress installation, it will exist in a subfolder, which is not ideal, especially for the link structure. Thanks in advance.

    • WPBeginner Support

      Hi Tanya,

      This method makes sure that your website is available on both locations during the transfer and before setting up permanent redirects.

      Administratör

      • Tanya

        Thanks for your reply. I have another question. If I use the Duplicator plugin, do I have to first create a database for the new site before I run the duplicator installer? Do you have instructions for doing this? The instructions above indicate that the installer should be put into a folder that is completely empty. That implies that I cannot first use the WordPress installer that comes with BlueHost to install WordPress (and I assume also creates the associated database). Thanks for your help.

        • WPBeginner Support

          Hi Tanya,

          Yes, you will need to create the database. We will soon update the article with more detailed instructions. Meanwhile, you can create a new database by visiting your hosting account’s Cpanel dashboard. Look for the databases section and click on MySQL Databases. You will first need to create a new database, after that you will need to create a new database user. Finally, you will need to add your new database user to your database.

  24. Micheal James

    how to do 302 redirect?

  25. Mikeal

    i have redirected my website but still i am having issues

  26. Castro

    Hey Wpbeginner, thanks for the article. How can i move my free domain under wordpress to a paid hosting and new domain name. Ive search everywhere but no clue. Thanks

  27. Kerry

    Hi Wp-Support,

    Thanks for such a great article. Though it’s was written months ago, it’s an evergreen article.

    However, my question is: I recently registered a new domain, in fact it is my first WordPress website. But it has not yet been indexed. Does the process you outlined here applies to my new site as well?

  28. Vince Hordemann

    Great article. I followed it step by step and it appears that my old site is now redirecting and that my Google Analytics and Webmaster Tools are all working too. Thanks!

  29. Georgia

    Hi!
    First of all I would like to congratulate you on your great, helpful and comprehensive posts. The steps seem really simple to follow.
    I want to ask something that is not yet covered, neither in the text, nor in your replies. Lets say that my current site is https://www.example.net (it already has a SSL certificate) and I want to redirect all pages to https://www.example.com ( https as well), without changing host provider.
    Which code should I use in .htaccess file? Should I do anything else?
    Thank you in advance!

  30. Manpreet Singh Rehsi

    Hi,
    What should we do with old domian name.

    For how much time one should keep old data as it is on the old domain.

  31. Jennifer

    Hi, I just purchased a new domain name and want to change the old domain to the new one. My worry now is, my current hosting does not have SSL cert and I am using the Cloudflare Flexible SSL. Do I need to put in redirect both http and https (even though I don’t have the cert in my hosting)?

    How about Cloudflare? Do I use the same account, edit it with new domain name or register a new account?

    Many thanks in advance.

  32. Brit

    Thanks for this. Does this only work for wordpress.org? I have wp.com and can’t seem to find the htaccess link and it looks like the only way to change my site name with the new domain is to pay to map it. Is this normal?

  33. kuber

    Hi,

    There is a question about my sitemap

    After submitting the new website’s sitemap to Search Console, the old website sitemap should be removed

  34. Rui

    Hi, thanks for your nice tutorial! Can you please clarify the best way to execute Step 4, when you have to migrate your site every 2 months or so due to having it blocked by the local authorities? Cheers

  35. Elise

    These directions helped me a lot! Thanks!

  36. Mick Lite

    If I change the domain, does all the stats in the blog stay like views and such?

  37. Russell Alexander

    My band has a sign up page (.net) and a website (.com). The .net is a redirect to a directory on the .com site, it’s not its own real domain. The .com is also a add-on domain of my main domain, so it’s like this:
    Main domain – add-on .com (as a folder of the main) – .net (a folder in the .com)

    I set up a WP site on my main domain. It put it in the root, even before the .www folder that has the main, the add-on, etc. But it has a specific path, so (finally) the question:

    Can I just change the redirect of the .net to the new WP install I’ve done? Sorry if this sounds like a Gordian knot, but that’s the best way I can explain it. I haven’t used WP much before, and I wanted to make sure it wouldn’t freak out being the subject of a redirect. As in, the plug-ins, Paypal, etc.. The redirect would really only affect the main landing page, where people sign up for the mailing list.

    Thanks for your help.

  38. Camila

    This article helps a lot thank you. I just have one question. I have my primary domain and the new domain and both point to the same root. When you type either domains they will go to the same homepage but of course all posts and pages are under the primary domain.

    This being said I’m not switching locations or anything. I mean the root file will remain the same I only need to switch is the domain name {with home and posts redirects of course}. So, do I need to do the whole duplicator step thing???

    This process is really scary for me!
    Any help will be appreciated.

    Kind regards
    Cami

  39. Chris ohrn

    For step 3 and step 4:

    if the site uses the same url, that should not be needed or?
    as well we got a 301 on our topp domain but don’t know how to remove it..
    The 301 is not there on the www. but without the www. it is there!

    A bit bizare and mindboggler..

    Thanks for thoughts:)

    • Swati Ohri

      Hi Team,

      I just moved from my old domain to a new one. I have a basic account on Bluehost hence the customer support team says I can’t add it as an addon domain to create 301 redirects. My old domain was 6 months old, now I have to again start from the very first step. Can you help me how I can fix this?

  40. Kristine

    Where I can find full service for domain migration?

    I need to migrating (rebranding) domain1.com to domain2.com with all of the contents and urls, also the subdomain. Looks like it’s a complicated job :(

    Thanks

  41. Hasi Aulia

    Hi there,

    I want to ask you, how about to redirect domain and change the paltform at the same times, I wanna move aaaa(dot)com (using blogspot custom domain) to bbbb(dot)com using wordpress self-host.
    What the best step to avoid losing my ranking at the search engine to do it?

    Thanks

  42. Logan Cale

    One question or factor typically not mentioned when you change a domain is how long does it take to get back your rank in Google, and the answer according to this article below is 2-6 months depending on what you do to improve it.

  43. Luiz Cent

    Thank you for publishing this article, I would not have remembered to notify Google of the change, I was simply going to resubmit the new site to index. Also have to make the change in GA!

    Much more work than anticipated but it’s done!

  44. Cliff

    First off, nice article very helpful.
    The question is how long do I need to leave the old site up? or can I delete the old site now that I have the new site up and running.
    Thanks in advance.

  45. hari kumar thapa

    I want to change my domain and move that WordPress to new hosting! will this have any effect only ranking? backlinks or like that?

    Any anyone suggests me any post how I can move my WordPress to Blogger completely?
    No just copy past I want to completely move into blogger.
    Is this possible?

  46. Pamela

    Is there a way to transfer Facebook comments from the old domain? I’m using facebook comments on my old website and would love to keep them on the new domain.

  47. Med

    Hi, I wan some help please

    My case is a little different

    I migrated content of my website example.com from blogger to WordPress with dedicated server and I decided to leave the first active until I finish the development of the wordpress version that has a provisional domain ’example. net’

    When I finished developing, I tried to permanently change the .NET domain name to .COM because I might lose all the search results from the search engines.

    How can I reach this goal and thank you

  48. Saimon Hossain

    Hello sir, i already change my site address in webmastertool, but now again i need to change the domain. so what should i do now?

  49. Emmanuel

    Good post, I am trying to move only partial content not the entire website. What is the best way to go about it and not lose SEO ranking?

  50. Emily Burnett

    Thanks so much for this post – very straightforward and helpful as I tackled something intimidating.

  51. Ryan

    Thank you!

    This content was exactly what I needed. Really really helpful.

    Much appreciated.

Lämna ett svar

Tack för att du väljer att lämna en kommentar. Tänk på att alla kommentarer modereras enligt våra policy för kommentarer, och din e-postadress kommer INTE att publiceras. Vänligen använd INTE nyckelord i namnfältet. Låt oss ha en personlig och meningsfull konversation.