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. WPBeginner Staff

    We are not sure about this option, we haven’t tried it ourselves so we can not recommend it. Any redirection you set up needs to be 301 so that search engines can update the new location.

  3. vikramforever

    I have my domain with godaddy and they have redirect option with match path mentioned on their help page – http://support.godaddy.com/help/article/5120/redirect-urls-with-your-hosting-account.

    Is this a feasible option when i transfer my active site to another domain? As per the option in the post, i need to maintain the hosting for my old domain till the time i want the redirects to work. Using redirect with the ’match path’ option will do away the need to do so. But i want to be sure that this is an option which works the same way the script (as you mentioned) works.

  4. Keely Worth

    Excellent – makes the process of moving a WordPress site a breeze. Thanks.

  5. Ayman

    I’ve just migrate a website site from one URL to another. I would really like to thank you for this great post. 100% working and a very simple instructions :)

  6. Anas Khan

    Nice post. I have few questions too,

    I have 2 blog on WordPress. The new blog is active and i have 45 posts in my new blog. The old blog has 192 posts and all posts are index on google.

    Now i want to transfer and publish all old 192 posts to my new blog so all posts can me view on my new blog. If i trash all posts from my old blog, remove the sitemap and webmaster tool of old blog and after 30 days i publish old posts to new blog using Add new post button then it works ? Is it considered a duplicate content ?

  7. Mohammed Saimon

    Yes its a nice post. Thanks to the author.

  8. Vinish Garg

    This is an excellent post and gave me some new direction for moving my WP blog from one domain to another. I will appreciate if you can correct me if I am wrong in planning it as below.
    – I know hostgator and I understand how to use File Manager and setup WP, database and import/export database (xml files)
    – My current WP blog is at: http;//www.example.com, and I want to move it to another domain http://www.example.org.
    – One, I will setup new WP at new domain’s root (database, config file, custom theme, and import data file from old site)
    – The new site will show the site exactly like old site, BUT only difference is the URL (because of new domain).

    If everything is correct this far… I am not sure how to use redirects for all my old domain’s pages/posts to new domain. Can you please advise?

    • WPBeginner Support

      You can do that by following the step 3 of this guide, setting up 301 redirects.

      Administratör

  9. Stefan

    Great post, unfortunately I have read it too late and have already moved my domain. All I have done is I have purchased a new domain for my blog (, before it was it’s still active for another 2 months). I have changed the WordPress URL and Site Address in wordpress general settings and resubmitted the sitemap with the new URL. That’s all I have done.

    This was one month ago and since then the traffic is now totally down, from more than 1,000 pageviews a day to now not even 200.

    If I google search ”thailand redcat” not even one of my pages shows up. The sitemap however has successfully been submitted:

    2:51:35pmStefan

    Do you know what could be the reason for this and how can I solve the problem and get the search results and eventually traffic back to normal again?

    Any help would greatly be appreciated. Cheers!

    • WPBeginner Support

      Stefan, we are not sure we understand the process you followed to move your site to a new domain. Here are some general tips. First make sure search bots are able to crawl and index your site? Check your site in Google webmaster tools for crawl errors.

      Administratör

    • Charlie

      I have the same problem. Google crawlers find a 500 error on the whole site since is did the migration. I tried on 2 different environments/providers, different php versions, I tried to deactivate/reactivate all my plugins one by one, I tried to regenerate the permalinks, the htaccess, the robots.txt… nothing works.

  10. Mr Joy

    Thank you for your great post. I followed your post and moved my site to new domain. It’s all working fine but there is only one problem in my site regarding WordPress visual editor. The problem is ”When I upload an Image on any post by Add Media option, then click on the picture thumble ”edit image” an iFrame come with a Not Found Error. But when click delete it works fine. Please help me to resolve the problem. Check the screenshot : http://bit.ly/1fqjE1b

    • WPBeginner Support

      The first thing you can try is to update your permalinks, simply go to Settings » Permalinks and click on the save changes button.

      Administratör

  11. AP

    Excellent work – thanks very much! It might be helpful to add the reply above – the one dealing with new database creation and use – to the initial instructions, as not everyone will read the comments before attempting a transfer.

  12. Gary Kirwan

    Great article. My question is I use the affiliate cloaking method recommended by Yoast, which means I have a .htaccess file under a folder called /out/
    Would I need to add the same 301 redirect code mentioned in the article to both .htaccess files in the root directory and affiliate links sub-folder? Does adding the 301 redirect code to the root directory .htaccess file only automatically cover the sub-folders one?
    My goal is to make sure that external affiliate links work correctly as well.

      • Craig

        Thanks. I’m stuck at the go to newsite.com/installer.php I just get my old site but with 404. I didn’t install wp in the new directory, just created an empty directory to put the installer and zip in. I am pointing my new domain from the registrar account to that new directory with my web host but not getting anything but the theme and 404. Any obvious tips?

        • Craig

          just FYI i resolved this. It appears to be an issue with 1&1 (no surprise) but can be resolved by having an index.html file present. So for anyone on 1&1 adjust step 2 from

          ”Make sure that the root directory, or the directory where you want to copy your website is completely empty.” to ”Make sure that the root directory, or the directory where you want to copy your website is completely empty except for installer.php, the .zip file AND an index.html page”

          I believe this is to do with the way 1&1 prioritise pages on their server.

  13. Denis Fitzgerald

    Hi – Thanks for the article. I have a question: I am switching my site from Tumblr to WordPress. It has its own domain. I would like to know if the buttons at the end of each article showing social shares, Twitter, Facebook, Google+, will maintain the original share count or go back to zero. Thank you.

    • WPBeginner Support

      If its the same domain and your URL structure remains intact, then hopefully you will be able to retain those social counts.

      Administratör

  14. Bertjan

    Excellent guide! Thank you very much.

  15. Sudha Mathew

    Hi, I moved my site using redirects about 6 months ago and it works fine. I need to renew my contract with web security company soon. So I need to know how much traffic is still getting redirected from the old site. Could you explain how to do that? I am not tech savvy but can use both Webmaster tools and Google Analytics.Thanks in advance!

    Best
    Sudha

  16. Moti

    Hello,

    I would like to change the domain name of my site (staying on the same host).
    In the instructions above it is indicated that I should ”make sure that the root directory, or the directory where you want to copy your website is completely empty.”.
    In my case the WP is installed in the root directory (I have the wp-content folder under public-html) – I assume that this means that my WP is installed under the root directory.
    Which folders should I clean / delete before I run the installed file generated by the duplicator ?

    Thanks,
    Moti.

  17. Declan

    Thank you for the tutorial. Worked great with no problems whatsoever.

    I do, of course, have a question regarding SEO.

    My old site wasn’t registered in Google webmaster tools, so obviously there’s no option to let them know about the changes I’ve made. My question is: Will I need to register my old domain with Google webmaster tools first, and then my second domain…and then notify them abut the changes?

    Any thoughts would be great.

    Thanks again for the article, it was extremely helpful.

    Declan.

    • WPBeginner Support

      Yes, you will have to notify about the change on your old site’s webmaster tools account. However, this is just the fastest way to do it. If you have setup your 302 redirects then search engines would pick that up as well.

      Administratör

  18. reza

    hi,

    this works just great, i redirect my old.com which is my main domain to new.com which is an addon domain (in the same hosting)

    but when i added another new addon domain, it makes my new addon domain can’t be accessed….it always redirect my addon.com to new.com/addon.com…

    can you help ??

  19. Jennifer @ Delicieux

    Thank you for explaining this in so much detail. I have a question though. I’ve been thinking about moving to a new domain name for some time, but I wanted to know if I would have any issues given the fact that earlier in the year I changed the permalink structure on my old blog.

    I followed the instructions on Yoast on how to change my permalink structure and edited my .htaccess file, and wonder if this will cause problems when I move to a new domain? This is the one thing that is holding me back because I don’t want things to screw up and lose rank and end up with broken links.

    • WPBeginner Support

      you can transfer your old .htaccess file to your new site. If the .htaccess file has any references to the old domain name then replace those with the new domain name and your would be OK.

      Administratör

  20. Hrayr

    Hey,
    First of all many thanks for this article – it worked great without any problem for me!

    I have one simple question specific to my case, would highly appreciate your thoughts on this.

    Basically i used this approach to copy my wordpress site from localhost to the host/domain from 3rd party.
    As said all worked ok – i just want to make sure that this approach doesn’t leave any old urls/links/references that can ”annoy” google to crawl this new site. My site is pretty basic, so in worst case scenario i can just recreate if there is any disadvantage of crawling/SEO when site is copied by duplicator.
    Is there any known SEO issue of new site that you are aware of?

    • WPBeginner Support

      We not aware of any SEO issues, but if you come across any you can inform the plugin author by opening a support thread on plugin’s page.

      Administratör

  21. Kevin

    I don’t think the way you suggest users do their 301 redirect is the best way. It’s well documented, even recommended by Google, that you do page-to-page redirects, NOT dump all your old website’s pages to the homepage of the new site. The htaccess code you provide does the latter. It isn’t a good way to preserve link juice.

    Maybe you can refer us to a good htaccess tutorial instead? There are also online htaccess generators out there that can make it much faster to do page-to-page redirects.

    • WPBeginner Support

      Kevin, you are right and rewrite rules in the article do exactly that. Instead of redirecting users to the homepage it sends them to the individual page. $1 at the end of code appends the link with the proper permalink structure.

      Administratör

  22. Julian

    Hi, when I’m doing this after ’deploy’ it misses the ’update’ section and reverts back to a 404 page at the old web address… any idea what could be causing this?

    Many thanks!

  23. Munna

    Thank you very much for this post. I was in trouble redirecting my oldsite visitors to the new site. But your .htaccess code made it super easy because both sites were in the same hosting server. :)

  24. Raspal

    Hello,

    I completed all the steps and the blog at the new site is up fine. But I can’t login to the admin area. I have two users, one is an admin user. I get this error when trying to login:

    ”ERROR: Cookies are blocked or not supported by your browser. You must enable cookies to use WordPress.”

    I tried different browsers and also tried clearing any cookies. Also tried changing password. Password was changed fine but still getting the above error.

    Can you please help ASAP?

    Using WP version 3.7.1

    Regards,
    Raspal

  25. Neil Bargas

    Thanks man! 100% working and a very simple instructions.

  26. Lynn

    Fantastic article! You are my hero of the day. :)

  27. Jahid

    ”Login to your new site’s WordPress admin using the same username and password that you had on the old site. Go to Settings » Permalinks in your new site’s WordPress admin and click on the save button.”

    Once I login, it shows me the first step page ”Step 1: Files & Database” instead of showing the WP dashboard. Help!

  28. Chrissy

    Hi! Thanks so much for this helpful article – I’m in the process of running through the steps now.

    My one question is:

    I have my blog hosted at one domain, let’s call it http://www.reallylongdomainname.com/blog, but I have a redirect to forward it to my other domain: blog.shortername.com. I now want to migrate the blog to shortername.com/blog, because some of the links don’t work after the redirect.

    All my posts and things already have permalinks at shortname.com/blog/post#, so do I really need to do any of this 301 stuff? Am I safe to skip steps 3, 4 & 5, or is there something I need to consider? And will I need to delete the old blog or just the redirect once I launch it at the new domain?

    Would be really great to find out how to proceed, since I’ve tried dozens of things this week and no situation is quite the same as mine :/ Thanks!

    • WPBeginner Support

      The purpose of 301 redirects is to not just redirect users but also let search engines know that you have moved to the new location so step 3 and 4 are a must otherwise it may affect your SEO rankings.

      Administratör

  29. Mark P

    Great post. One question though.

    Let’s say someone clicks on a backlink for my website’s old domain. (Let’s call it olddomain dot com / blogpost1). Will this then redirect to the new domain’s respective link (newdomain dot com / blogpost1) instead of just redirecting to the new domain’s homepage?

    • WPBeginner Support

      Yes, it would redirect users landing on your posts and pages on the old site to the posts/pages on the new site.

      Administratör

      • Mark P

        Thank you!

  30. Morgan

    Question: I am switching my site from one host to a new host. At the same time, I am changing my domain name. I have already successfully transferred my WordPress site to my new host using the new domain name. I now am to step 3 and want to use 301 redirects to point those old URLs to the new site URLs. However, the old site is on the old host and I’m planning on getting rid of that site.

    Will the 301 redirects still work? Or do I also need to move the old site over to my new host and THEN do the redirects? I’m a bit unsure what to do and would love any advice.

    • WPBeginner Support

      If it is possible for you to keep the old site online for at least a month, then you can add 301 redirect. After that update your site’s information on Google Webmaster tools. Once you have recovered your search rankings and traffic you can then close your account with the old web host.

      Administratör

  31. Nj

    Thank you for the helpful posts, but sometimes with such plugins, a video will help A LOT. I hope you will consider this :)
    Thanks again

  32. Arnold

    Hi. Could you please elaborate the part where you said ”The installer will ask you to provide database information for the new site and check the box for Table removal?” Where do I find this database information? So should I check the box for Table removal? Thanks!

    • WPBeginner Support

      This is the database where you will be importing your old site from the package you created earlier. Log into your web hosting dashboard, find phpmyadmin and create a new database. Come back to installer.php and provide the new database name, host, user and password.

      Administratör

      • Kara Lumsden

        So you should not install wordpress on the root of the new domain? The only thing you need to do on the new domain is only create a new database, is that correct? Can you elaborate a little more on how to create the database in phpmyadmin?

        So appreciative, thank you for all that you do!

        • WPBeginner Support

          No it is OK to install WordPress on the root of the new domain. Yes, you just need to create a new database and the Duplicator takes care of the rest.

        • Kara Lumsden

          Can you please provide instructions on how to create the database?

          Thank you very much,
          Kara

  33. Dennis J. Smith

    How long should one wait before deleting the old site?

    • WPBeginner Support

      30 to 90 days, depends on how successful your move was. If you are confident that your new domain has gained nearly the same traffic as the old site, then you can delete it.

      Administratör

  34. dyer

    Hi ive encountered an issue. Im unable to save my Permalinks as I cant locate the WP admin file ive tried to upload the WP admin file again but this hasn’t the issue please could you advise me if there is any other steps I can take to rectify this issue.

    Thanks

    Dyer

    • WPBeginner Support

      @dyer We are unable to understand your question. We are assuming that you can not access your WordPress Admin area. In that case, connect to your site using an FTP client like filezilla. Find the file .htaccess download it to your hard disk and delete it from your website. Hope this resolves your issue.

      Administratör

  35. Fakhre

    Thanks for the article guys!

    I am hosting my site on Bluehost and just want to change the Domain name without loosing the SEO and backlinks.

    My site contents is huge, i have about 8000 posts. Any solution for renaming the domain??

  36. Sanjay Patel

    Hello…
    Really useful information but duplicator plugin is not working in my website. please solve my problem. how to do this?

    Thanks in advance.

  37. Dinah

    Does this work with moving from one domain to a subdomain?

  38. Dinah

    Does this work for moving to a new subdomain? Like if my wordpress blog was on oldsite.com and I wanted it on blog.newsite.com, would I do the same thing?

  39. Emmie

    I recently did this and the links and all redirected fine and dandy, however I just got slapped by Google with a penalty for instantly having so many backlinks – they think I bought them. Has anyone else encountered this? I made the appropriate notifications in Google Webmaster tools before moving, and it’s done nothing to help this. It’s hit me hard, so if anyone has experience in remedying this, please share!

    • Editorial Staff

      Hey Emmie, where do you see that you get slapped for having too many backlinks? Does it show you that error in your Webmaster Tools? Just trying to see how did you come to the conclusion that you got penalized by google.

      https://www.google.com/webmasters/tools/reconsideration << This is the page where you can send a reconsideration request to Google.

      Administratör

  40. Lateef Adewale

    Do you have any idea if this will work if i am moving a site from Bluehost to Wp Engine.

  41. Emily

    Just went through this whole process, worked perfectly and just what I needed to know. Thank you WPBeginner! The only glitch I ran into was my own fault – didn’t deactivate my security plugins first so I had to do it all over. Now, I am an expert… : )

  42. Sandra Christie

    Thanks for the article!

    Are the steps for moving the same domain to a new host basically the same? And can that cause a drop in SEO as well?

  43. Travis Pflanz

    As well, the ”Change of Address” option in Webmaster Tools is now in the Options menu at the top right in in Gear icon.

  44. Zach Smith

    Thanks for publishing another great article for us. This is best for any technology related blog.

  45. Bob

    Thanks–this is great information. I’m really excited to learn about Duplicator. While moving a domain is something I might have to do occasionally, I’m constantly cloning environments for development and testing purposes. The manual cloning process I’ve been using is time-consuming and potentially error-prone. Duplicator has the potentially to be a considerable improvement!

  46. Sam

    I just moved WP to a new domain and server using this method. Webmaster Tools now shows many 403 errors on the new server for each folder in uploads such as wp-content/uploads/2012/07 and one 403 error for each of the months. On my old server I did not get this. When moving the site should we also change or check the permissions? What should they be for the wp-content/uploads folder?

    • Editorial Staff

      Google should not be indexing the folders rather they should be indexing the files inside of it. If you try to access the folder directly using a browser, WordPress will give you a 404 error. You don’t want to allow access to a directory that has no index page, which will then produce a directory listing that will get indexed and crawled, including the links to all files.

      Administratör

      • sam

        Thanks for the reply. Then why does Google show a 403 error for the folders in webmaster tools. Does this not mean that something is wrong?

  47. Zimbrul

    THIS IS THE ARTICLE I WAS LOOKING FOR 1 YEAR NOW!!

  48. Jasim Ahmed

    Duplicator is great plugin but problem is its not work with some server as its need higher PHP version except this is there any other way to do ?

    • Editorial Staff

      Yes, you can manually download the files and the database. Upload them on the new domain. Replace all the old url instances in the database using phpMyAdmin SQL search and replace query. The easier solution would be to ask your host why they are not on the higher versions of PHP or switch to a better host.

      Administratör

  49. iAn

    hi, I believe this won’t preserve your social network network sharing counters (number of shares and likes). Any idea how to retain those popularity meter?

    • Editorial Staff

      You can’t retain the social counts because those go based on your canonical URLs which will be the new site (very important for SEO). The counters are mainly for social proof. All existing links in social media will properly redirect, so you won’t lose any traffic there.

      Administratör

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.