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 sammanfogar du två webbplatser i WordPress utan att förlora sökmotorsoptimering

Vissa webbplatsägare skapar flera WordPress webbplatser men vill senare slå samman dem. Att konsolidera ditt content till en enda, kraftfull website kan effektivisera ditt arbetsflöde och öka din sökmotorsoptimering.

Våra läsare frågar oss regelbundet om det bästa sättet att slå samman två webbplatser utan att förlora sökmotorsoptimering. Lyckligtvis kommer WordPress med built-in tools för att göra detta enkelt.

I den här artikeln visar vi dig hur du på rätt sätt sammanfogar två WordPress webbplatser. Vi kommer att täcka alla viktiga steg för en smidig övergång som bevarar din värdefulla sökmotorsoptimering.

How to Merge Two WordPress Sites Together Without Losing SEO

Varför slå ihop två webbplatser i WordPress?

Det finns många anledningar till att man vill slå samman två eller flera WordPress webbplatser.

Till exempel kanske de vill starta en new WordPress-blogg genom att kombinera sina gamla bloggar, vilket allow dem att ha allt sitt content på en och samma location.

Eller så kanske en av deras bloggar inte går så bra, så de vill slå samman dess content med en av deras primära bloggar som är utan problem.

Ofta bestämmer sig användare av WordPress för att slå samman sina webbplatser helt enkelt för att det tar mindre tid och ansträngning att underhålla en enda website än flera separata WordPress installationer.

Istället för att runka, marknadsföra, updating och säkerhetskopiera två eller flera webbplatser kan de fokusera på att underhålla och utveckla bara en WordPress-webbplats.

Med det sagt, låt oss ta en titt på hur du enkelt kan slå samman WordPress webbplatser tillsammans. Här är de steg du behöver för att completed:

1. Förberedelser inför flytten

I den här tutorialen säger vi att du har en sekundär WordPress site på http://secondarysite.com och att du vill slå samman den med din primära website på http://primarysite.com/.

För att se till att your content överförs smidigt från en site till en annan finns det några saker du behöver göra i förberedelse.

Kontrollera WordPress Media Settings

You should check your media settings to make sure that the primary site will not reject any images from the secondary site because of their size.

Först måste du besöka Settings ” Media page på båda webbplatserna.

Se nu till att filstorlekarna Medium och Large på den primära webbplatsen har maximala inställningar som är samma eller större än inställningarna på den sekundära webbplatsen.

Media Settings Image Sizes

Därefter måste du besöka Media ” Add New på båda webbplatserna för att kontrollera den maximala filstorleken för uppladdning.

Du måste se till att denna inställning på den primära webbplatsen är densamma eller större än inställningen på den sekundära webbplatsen. Om den är mindre kan det hända att vissa av dina images inte importeras.

Check current file upload size limit

Hur du ändrar den här inställningen kan du läsa i vår guide om hur du ökar den maximala storleken på filuppladdningen i WordPress.

Installera alla nödvändiga tillägg

Många tillägg till WordPress lagrar data. Dessa inkluderar tillägg för ecommerce, medlemskap, forum och mycket mer.

Om dessa tillägg lagras i en speciell Database table, och den tabellen inte finns på den sekundära webbplatsen, kommer de inte att kunna importeras. Se därför till att du installerar tilläggen på den primära webbplatsen innan du försöker importera deras data.

Nu hanterar plugins data på olika sätt, så det finns en chans att data från vissa plugins inte importeras ändå. Det är mycket viktigt att manuellt kontrollera att all din viktiga data har importerats utan problem efter att ha följt denna tutorial.

Import! Glöm inte att skapa en komplett WordPress backup av båda dina websites med hjälp av ett plugin som gillar Duplicator. Detta kommer att vara praktiskt om något går fel och du vill återkalla ändringarna.

2. Exportera content från den sekundära WordPress-webbplatsen

Nu är du redo att exportera all content från den sekundära WordPress website.

Först måste du besöka admin området på din sekundära WordPress site och sedan navigera till Tools ” Export page.

Export content from your secondary WordPress site

Se till att du väljer alternativet ”Allt innehåll” och klicka sedan på knappen ”Download Export File”.

WordPress förbereder omedelbart en XML-fil och downloadar den till din dator. Du kommer att behöva den här filen i nästa steg.

Denna exporterade fil kommer att innehålla följande:

3. Sammanfoga content till den primära WordPress-webbplatsen

Nu när du har exporterat innehåll från din sekundära site är det dags att slå samman det med innehållet på din primära WordPress site.

Head över till admin area på destinationssiten (den primära site där du vill att innehållet ska slås samman) och besök Tools ” Import page.

Install WordPress importer

På denna page listas alla tools för import som du kan installera och run på din site i WordPress. Rulla längst ner och klicka på länken ”Install now” under WordPress.

När importören av WordPress har installerats klickar du på länken ”Run Importer” för att fortsätta.

Run WordPress importer

Därefter kommer du att bli ombedd att uploada exportfilen för WordPress.

Du måste clicka på knappen ”Choose File” och sedan selecta XML-filen som du downloadade tidigare.

Upload WordPress import file

Klicka på knappen ”Upload file and import” för att fortsätta.

WordPress kommer nu att uppladda din exporterade fil och analysera den. Efter det kommer du att redirectas till sidan med inställningar för import.

WordPress import settings

Du blir ombedd att tilldela författare eller skapa nya författare. Du kan tilldela det importerade innehållet till en befintlig användare på din WordPress site eller skapa en new author.

Därefter kontrollerar du boxen i ”Import Attachments” section. Detta kommer att downloada och importera attachments som dina images och andra media files från den andra website.

I vissa fall kan det dock finnas images som inte går att importera, så vissa posts kan fortfarande länka till images på den sekundära websites. Vi fixar detta i nästa steg.

Du kan nu clicka på knappen ”Submit” för att runna det sista steget i importen.

WordPress importerar content från din exporterade fil och addar det till din primära WordPress site. När det är slutfört kommer du att se ett success message.

WordPress import finished

Nu kan den här page också visa en lista över objekt som inte gick att importera. Ofta beror detta på att objektet redan finns på webbplatsen, men ej alltid.

Det kan vara så att det uppstod ett problem när en image skulle importeras eller att en tabell som finns på din sekundära site inte finns på din primära site. Som vi sa tidigare kan detta orsakas av olika inställningar för images på de två webbplatserna, av ett tillägg som saknas eller av någon annan issue.

Du kanske vill obs/observera dessa Misslyckade objekt ifall du behöver kopiera dem manuellt från den sekundära website.

4. Importera externa images

Om det fanns några problem med importen av bilder kan vissa av de posts du importerade fortfarande hämta images från den sekundära webbplatsen. Dessa anropas som ”externa images” och är inte det bästa för WordPress prestanda eller sökmotorsoptimering. Vi fixar det i det här steget.

Det enklaste sättet att importera externa images är att installera och aktivera pluginet Auto Upload Images. För mer detaljer, se vår Step-by-Step guide om hur du installerar ett plugin för WordPress.

Note : Även om detta plugin inte har uppdaterats på ett tag fungerar det fortfarande bra i våra tester. Du kanske vill läsa vår artikel om om du vill använda tillägg som ej testats med din WordPress-version.

Pluginets standardinställningar för import kommer att fungera för de flesta användare, men du kan ändra dem genom att besöka Settings ” Auto Upload Images page. Om du till exempel vill importera images som är bredare än 600px, måste du ändra inställningarna för image-storlek.

Därefter måste du besöka Posts ” All Posts page och välja alla dina posts så att pluginet kan uppdatera alla externa images de innehåller.

Du kan bara välja posts på en page i taget, så du kommer snabbare framåt om du visar så många posts som möjligt på en page.

Du kan göra det genom att klicka på knappen Screen Options högst upp på sidan Posts.

Changing the number of WordPress pages on a single screen

You need to increase the number in the ’Number of items per page field’ field to ’999’ and click the ’Tillämpa’ button. Om du är orolig för att din hosting provider kanske inte kan updating så många posts på en gång, kan du skriva in ett mindre antal.

WordPress kommer att ladda om page och den kommer att lista 999 posts. Du kan snabbt välja dem all genom att klicka på checkboxen bredvid ”Rubrik”.

Därefter väljer du ”Edit” från menyn Bulk actions och klickar på knappen ”Tillämpa”.

Edit Multiple Posts at Once With Bulk Actions

WordPress kommer nu att visa dig en ”Bulk Edit” box med alla valda posts. Se till att du inte ändrar några av inställningarna i den här boxen.

Klicka bara på knappen ”Update”, så importerar pluginet alla externa images som det hittar i de valda posts.

Updating All Posts in Bulk

Nu, om du har fler än 999 inlägg, måste du besöka nästa sida för att välja de återstående inläggen.

Detaljerade anvisningar hittar du i vår guide om hur du importerar externa images i WordPress.

5. Setting Up Redirects

När du utan problem har sammanfogat content från två WordPress-webbplatser är nästa steg att konfigurera redirects så att användare som besöker den gamla webbplatsen automatiskt omdirigeras till den nya WordPress-webbplatsen.

You will need to edit the .htaccess file on the old WordPress site.

Du kan edit .htaccess-filen genom att ansluta till din WordPress-webbplats med en FTP-klient eller genom att använda verktyget File Manager i cPanel på din dashboard för WordPress-hosting.

Edit .htaccess file

.htaccess-filen är placerad i rotmappen på din website. Om du inte kan hitta den, se vår guide om varför du inte kan hitta .htaccess-filen på din WordPress site för att avidentifiera den.

You need to place this code at the top of your .htaccess file:

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

Glöm inte att ersätta primarysite.com med domain name för din primära site i WordPress. Sedan måste du save dina ändringar och uploada filen tillbaka till din server.

You can now visit any post URL from your secondary WordPress site, and you will be automatically redirect to the same post on the primary site.

6. Felsökning efter sammanslagning av två webbplatser i WordPress

Nu när du har slagit samman dina två WordPress webbplatser bör du se till att du inte missar några viktiga data och att din sammanslagna site fungerar som förväntat.

Här är några steg för felsökning som du kan vidta.

Hur man slår samman och massredigerar kategorier och taggar

Du kanske vill städa upp kategorier och taggar efter att ha slagit samman två WordPress webbplatser. För detaljerade instruktioner, kontrollera vår tutorial om hur man sammanfogar och massredigerar kategorier i tags i WordPress.

Så här fixar du URL:er som pekar på den gamla domänen i posts och pages

Alla interna links i importerade posts och pages kommer fortfarande att peka till din gamla site. Eftersom du har ställt in redirects kommer dina användare fortfarande att landa på korrekt post på din nya site.

Men du behöver fortfarande updating URL:er för förbättrad sökmotorsoptimering och bättre användarupplevelse.

Lyckligtvis är detta enkelt att göra med tillägget Search & Replace Everything.

För Step-by-Step instruktioner, se vår tutorial om hur du uppdaterar URL:er när du flyttar din WordPress site.

Vi hoppas att den här artikeln hjälpte dig att slå samman två WordPress webbplatser. Du kanske också vill se vår ultimata checklista för sökmotorsoptimering av WordPress eller vårt expertval av de bästa tjänsterna för migrering av 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

34 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. Melody

    Would this be the same as copying the posts and products to the new website?

    • WPBeginner Support

      Similar, this would also tell search engines to go to the new post on your site instead of the old post on the old sites :)

      Administratör

  3. micibama

    Thanks for sharing this important guide. I have followed the guide accordingly however, my old site contents are not showing on my new site. They are saying page not found. Do i need to replace all the codes in the .htaccess with the one given above? Please help

    • WPBeginner Support

      You shouldn’t need to replace your entire htaccess unless you have code that would conflict with our recommendation. You would likely want to resave your permalinks to help with the most likely reasons.

      Administratör

  4. Keval Padia

    Excellent content. We used to maintain two separate blogs for individual niche and were looking to merge both together without hampering our SEO. These steps are detailed and easy to follow, thanks for writing!!

    • WPBeginner Support

      You’re welcome, glad our guide was helpful :)

      Administratör

  5. Monique Martens

    Hi there,

    Thanks for this interesting and helpful guide!

    Can you tel us what will happen with pages and posts that have the same name and/or ID number? For example, each website has a home, blog and contact page. Will these be separate pages with the same name?

    Best regards,
    Monique

    • WPBeginner Support

      The posts will have the same name but the slug will be modified to be unique unless they are an exact copy of what you have currently on your site.

      Administratör

  6. Keir Briscoe

    I get a 405 error when I try to import. I am the creator and admin for both sites. I am also logged into both sites. I doubt anyone will reply to this message. but though I would leave it anyway

  7. Romona

    Hello,
    If I have a new theme at my new site and new host, where will the pages go and will they automatically adjust to the new theme? By pages I mean (diy, recipes, life, etc). Will I need those exact page headings for it to fall into the correct category or will they all fall together into one category?
    THANK YOU for your help!

  8. Paul

    Hello,

    Very good article! Exactly what I was looking for in terms of merging two WordPress sites. I was curious though if this could be applied on sites with WooCommerce for example?

    Thank you for this well written procedure.

  9. Steve

    I have oldsite.org which has a blog in the root and 2 more blogs at /nytips/ and /nynews/ and a community at /nyforum/ and want to make /nytips/ and /nynews/ a category of the blog in the root so the search box will work for the entire site plus giving me the chance to maintain one blog and one forum. Will this article help or will I have to use oldsite.net first then move it back to oldsite.org?

    Each folder was a domain which I consolidated 5+ years as I did not want to buy SSL certs for each domain and their aliases.

  10. Edmond Chan

    Hi team, thanks very much for this info. I edited my .htaaccess file in my old wordpress site to redirect to the new site. I used the code in the article above. However, I’m not able to access oldsite.com/wp-admin anymore as it redirects to newsite.com/wp-admin! Is there anyway to still access the old site’s admin dashboard to update plugins, wordpress itself or for any other reasons? Many thanks, Ed

    • WPBeginner Support

      Hi Edmond,

      You will need to remove the .htaccess redirect to access old site admin area.

      Administratör

      • Edmond Chan

        Hi Team,

        Thanks very much for your reply. The problem is that because the old site admin area immediately redirects to the new site’s admin area, I literally can’t access the old site’s .htaccess file in order to edit/remove the redirect. It’s chicken and egg! Is there any way to fix this?? Many thanks, Ed

  11. ranga

    Hi!
    We moved our content from siteA to siteB both of which use wordpress CMS. After merging the content do we need to change the address in google websmaster tools.? Thanks.

  12. Ilyas

    I have merged my websites and all of the posts are on my new website.
    But When I search an article, still the url and name of my old website my old website appear on the search engine.
    What if I delete my old website or if it expires?

    • Alan

      The best thing is to set redirects up from your old website to your new website and never let it expire.

  13. John

    Thanks for an interesting and useful article.
    I am in process of merging three websites with my older and larger main site. I’ve been doing this manually and it’s taking ages. I didn’t realise it was possible to do it automatically. HOWEVER, one issue I’m facing doesn’t seem to be covered in your article. If I choose ”all content” when I export from one site, will that include the comments the posts have attracted? If not, how to export/import comments?
    Many thanks,
    John

  14. Jack

    Would it be ok to redirect single blog posts one by one over a time periode of one year.

    E.g. Every week two blog posts from one blog (the one fizzling out) are republished to the main focus blog. And 2 redirects are done every week for a year.
    This process goes on until all are moved to main blog (say 100 posts over a year). Would that be a bad idea in teems of SEO?

  15. Chris

    Hi Folks,

    With a merge, what’s the situation about page/post IDs? If we are dealing with bigish sites surely there is a chance the page ID will be duplicated on import? Will that cause problems, and if so how to avoid/fix it?

    Cheers,
    Chris

    • Jack

      Would it be ok to redirect single blog posts one by one over a time periode of one year.

      E.g. Every week two blog posts from one blog (the one fizzling out) are republished to the main focus blog. And 2 redirects are done every week for a year.
      This process goes on until all are moved to main blog (say 100 posts over a year). Would that be a bad idea in teems of SEO?

  16. Gemma

    Hi,

    I’m curious to know, when importing the OLD site into the NEW, will it adopt the theme settings of the NEW site automatically?
    How can I make sure they match?

    Thanks

  17. Melissa

    How long before you could delete the original WP site?

    • WPBeginner Support

      Once you are satisfied that the old site is no longer getting any traffic, you can delete it. However, if the original site is still getting significant traffic from sources other than search engines, then you may want to keep the domain up as long as possible.

      Administratör

  18. Karakaplan

    How long should keep Redirect htaccess file in old server?

  19. Alan

    I’d like to import one websites posts into a particular category or custom post type. Then a different redirect will be needed. Can you make a tutorial fo that?

  20. Valentine

    Thanks for this information. I’ve successfully merged my two sites and they are working properly from one dashboard. Nice Job

  21. Georgina Moon

    This is interesting and helpful. But I have the opposite question – I want to start a new Wordpress blog, and export only certain posts to the new blog (e.g., all my posts with certain tags or categories, such as Greece, sailing etc). I have laboriously been copying and pasting, but I have to add the photos again, plus tags and categories. Is there a quicker way, please?

    • WPBeginner Support

      Hi Georgina,

      Yes, you can do this here is how.

      First create a new category in WordPress, you can all it anything you want.

      Next, you need to go to Posts -> All Posts screen. Click on screen options button at the top right corner. Under ’Number of items to show per page’ enter a number larger than total number of posts on your site then click on Apply button.

      WordPress will now load all your posts on the same page. Check the box next to the posts you want to move. Then select ’Edit’ from ’Bulk Options’ drop down menu and click on the Apply button.

      A box will appear with a number of options. Simply select the category you created earlier to file all selected posts under that category. Click on update button to save your changes.

      Now you can go to Tools -> Export page. Select posts and then under export settings select the category that has all the posts you want to move.

      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.