Récemment, un de nos lecteurs nous a demandé comment fusionner deux sites WordPress ? Il peut arriver que vous créiez plusieurs sites WordPress et que vous souhaitiez ultérieurement les fusionner. WordPress est livré avec des outils intégrés qui permettent de le faire facilement. Dans cet article, nous allons vous afficher comment fusionner correctement deux sites WordPress.
Pourquoi fusionner deux sites WordPress ?
Il peut y avoir de nombreuses raisons de fusionner deux ou plusieurs sites WordPress. Vous souhaitez peut-être créer un nouveau blog WordPress en regroupant vos anciens blogs afin d’avoir tout votre contenu au même endroit.
Une autre raison pourrait être que l’un de vos blogs ne se porte pas très bien, et vous voulez fusionner son contenu avec l’un de vos blogs principaux.
La plupart des utilisateurs/utilisatrices fusionnent des sites WordPress pour passer moins de temps à maintenir une installation WordPress séparée. Au lieu de gérer, de commercialiser, de mettre à jour et de conserver des sauvegardes WordPress pour deux sites ou plus, vous pouvez vous concentrer sur la maintenance et la croissance d’un seul site WordPress.
Voyons comment fusionner facilement des sites WordPress.
Exporter le contenu d’un ancien site WordPress
Pour les besoins de cet exemple, nous dirons que vous avez un site WordPress à l’adresse http://oldsite.com et que vous souhaitez le fusionner avec http://newsite.com/.
Importance : N’oubliez pas de créer une sauvegarde WordPress complète de vos deux sites. Cela vous sera utile en cas de problème et si vous souhaitez revenir en arrière.
Tout d’abord, vous devez visiter la page Outils » Exporter à l’intérieur de la zone d’administration de votre ancien site WordPress. Il s’agit du site que vous souhaitez fusionner avec le nouveau site.
Assurez-vous de sélectionner l’option » Tout le contenu « , puis cliquez sur le bouton » Télécharger le fichier d’exportation » pour continuer.
WordPress va maintenant préparer un fichier XML et l’envoyer à votre navigateur. Vous devez enregistrer ce fichier sur votre ordinateur car vous en aurez besoin à l’étape suivante.
Ce fichier contiendra les éléments suivants :
- Toutes vos publications et pages WordPress
- Tous les types de publication personnalisés (si vous en avez)
- Toutes les catégories, identifications et taxonomies personnalisées (si vous en avez).
Fusionner le contenu d’un nouveau site WordPress
Maintenant que vous avez exporté le contenu de votre ancien site, il est temps de le fusionner avec votre nouveau site WordPress.
Titre de la zone d’administration du site de destination (le site où vous voulez que le contenu soit fusionné) et visitez Outils » page d’importation.
Cette page répertorie tous les outils d’importation que vous pouvez installer et exécuter sur votre site WordPress. Défilez vers le bas et cliquez sur le lien « Installer maintenant » sous WordPress.
Une fois l’outil d’importation WordPress installé, vous devez cliquer sur le lien « Exécuter l’outil d’importation » pour continuer.
Ensuite, il vous sera demandé de téléverser le fichier d’exportation WordPress.
Vous devez cliquer sur le bouton » Choisissez un fichier « , puis sélectionner le fichier XML que vous avez téléchargé plus tôt.
Cliquez sur le bouton « Téléverser le fichier et importer » pour continuer.
WordPress va maintenant téléverser votre fichier d’exportation et l’analyser. Après cela, il vous redirigera vers la page des Réglages d’importation.
Il vous demandera d’assigner des auteurs/autrices ou de créer de nouveaux auteurs/autrices.
Vous pouvez assigner le contenu importé à un utilisateur existant sur votre site WordPress ou créer une nouvelle auteur/autrice.
Ensuite, cochez la case sous l’option » Importer des fichiers joints » pour importer les fichiers médias joints de votre ancien site WordPress.
Vous pouvez maintenant cliquer sur le bouton Envoyer pour exécuter la dernière étape de l’importation.
WordPress va maintenant importer le contenu de votre fichier d’exportation et l’ajouter à votre nouveau site WordPress. Une fois l’opération terminée, un message de réussite s’affichera.
Réglages des redirections
Après avoir bien fusionné le contenu de deux sites WordPress, l’étape suivante consiste à configurer les redirections afin que les utilisateurs/utilisatrices visitant l’ancien site soient automatiquement redirigés vers le nouveau site WordPress.
Vous devrez modifier le fichier .htaccess de l’ancien site WordPress.
Vous pouvez modifier le fichier .htaccess en vous connectant à votre site WordPress à l’aide d’un client FTP ou en utilisant l’outil Gestionnaire de fichiers dans le cPanel de votre hébergeur WordPress.
Le fichier .htaccess est situé dans le dossier racine de votre site. Si vous ne le trouvez pas, consultez notre guide sur pourquoi vous ne pouvez pas trouver le fichier .htaccess sur votre site WordPress pour le démasquer.
Vous devez placer ce code en haut de votre fichier .htaccess.
#Options +FollowSymLinks RewriteEngine on RewriteRule ^(.*)$ http://www.newsite.com/$1 [R=301,L]
N’oubliez pas de remplacer newsite.com par le nom de domaine de votre nouveau site WordPress. Enregistrez vos modifications et téléversez le fichier sur votre serveur.
Vous pouvez maintenant visiter n’importe quelle publication sur votre ancien site WordPress, et vous serez automatiquement redirigé vers la même publication sur le nouveau site.
Dépannage après la fusion de deux sites WordPress
Comment fusionner et modifier en masse des catégories et des identifiés ?
Vous pouvez vouloir nettoyer les catégories et les identifiants après avoir fusionné deux sites WordPress. Pour des modifications détaillées, consultez notre tutoriel sur la façon de fusionner et de modifier en masse les catégories dans les identifiants dans WordPress.
Comment importer des images manquantes ?
Pour cela, vous devrez désactiver temporairement la redirection en modifiant le fichier .htaccess et en retirant le code que vous avez ajouté plus tôt. Après cela, vous pouvez suivre les instructions de notre guide sur l’importation d’images externes dans WordPress.
N’oubliez pas de configurer à nouveau les redirections après l’importation de vos images.
Corrigez les URLs pointant vers l’ancien domaine dans les publications et les pages
Tous les liens internes dans les publications et pages importées pointeront toujours vers votre ancien site. Comme vous avez configuré des redirections, vos utilisateurs/utilisatrices atterriront toujours sur la publication correcte de votre nouveau site.
Cependant, vous devez mettre à jour les URL pour améliorer le référencement et le compte des utilisateurs/utilisatrices. Pour des instructions étape par étape, consultez notre tutoriel sur la mise à jour des URL lors du déménagement de votre site WordPress.
Nous espérons que cet article vous a aidé à fusionner deux sites WordPress. Vous pouvez également consulter notre guide de référencement WordPress étape par étape pour les débutants.
Si vous avez aimé cet article, veuillez vous abonner à notre chaîne YouTube pour des tutoriels vidéo WordPress. Vous pouvez également nous trouver sur Twitter et Facebook.
Syed Balkhi says
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!
Melody says
Would this be the same as copying the posts and products to the new website?
WPBeginner Support says
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
Administrateur
micibama says
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 says
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.
Administrateur
Keval Padia says
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 says
You’re welcome, glad our guide was helpful
Administrateur
Monique Martens says
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 says
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.
Administrateur
Keir Briscoe says
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
Romona says
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!
Paul says
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.
Steve says
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.
Edmond Chan says
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 says
Hi Edmond,
You will need to remove the .htaccess redirect to access old site admin area.
Administrateur
Edmond Chan says
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
WPBeginner Support says
Hi Edmond,
You can use FTP to edit .htaccess file.
ranga says
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.
Ilyas says
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 says
The best thing is to set redirects up from your old website to your new website and never let it expire.
John says
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
WPBeginner Support says
Hi John,
Yes, comments will included in the export file.
Administrateur
Jack says
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?
Chris says
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 says
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?
Gemma says
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
Melissa says
How long before you could delete the original WP site?
WPBeginner Support says
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.
Administrateur
Karakaplan says
How long should keep Redirect htaccess file in old server?
Alan says
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?
Valentine says
Thanks for this information. I’ve successfully merged my two sites and they are working properly from one dashboard. Nice Job
WPBeginner Support says
Glad you found it helpful don’t forget to follow us on Facebook for more WordPress tips and tutorials.
Administrateur
Georgina Moon says
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 says
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.
Administrateur