wordpress 多站点
Are you trying to split your WordPress multisite network into individual WordPress websites? Moving a single to its own domain is a challege that a lot of multisite admins come across. While running a multisite network has its own advantages, sometimes a single site may outgrow the network and need its own space. In this article, we will show you how to move a website from WordPress multisite network to its own single install of WordPress.
您是否正在尝试将WordPress多站点网络拆分为单个WordPress网站? 将单个移动到其自己的域是很多多站点管理员遇到的难题。 尽管运行多站点网络有其自身的优势,但有时单个站点可能会超出网络规模并需要自己的空间。 在本文中,我们将向您展示如何将网站从WordPress多站点网络迁移到其自己的WordPress单一安装。
Important: Since you are going to do some serious changes to your site, it is necessary to create a full WordPress backup before you do anything else.
重要提示:由于您将对网站进行一些重大更改,因此在执行其他任何操作之前,必须创建完整的WordPress备份 。
步骤1:在WordPress多站点网络中导出单个站点 (Step 1: Exporting a Single Site in WordPress Multisite Network)
The built-in WordPress import/export functionality works the same way in multisite as it does on a single site install. We will be using the default tools to export the data from a site on WordPress multisite network.
内置的WordPress导入/导出功能在多站点中的工作方式与在单个站点安装中的工作方式相同。 我们将使用默认工具从WordPress多站点网络上的站点导出数据。
First you need to login to the dashboard of the single site you want to move, and then click on Tools » Export. Next, you want to make sure that all content is checked and click on the Download Export File button.
首先,您需要登录到要移动的单个站点的仪表板,然后单击工具»导出 。 接下来,您要确保选中所有内容,然后单击“ 下载导出文件”按钮。
WordPress will now create an XML file containing all your data and send it to your browser for download. Save the file in your computer because you will need it in later steps.
WordPress现在将创建一个包含所有数据的XML文件,并将其发送到浏览器进行下载。 将文件保存在计算机中,因为在以后的步骤中将需要它。
步骤2:安装WordPress (Step 2: Installing WordPress)
Now that you have exported the files, you will need to set up a separate install of WordPress. Here is our tutorial on how to install WordPress. Once you have installed and setup WordPress, you can move on to importing your child site.
现在,您已经导出了文件,您将需要单独安装WordPress。 这是我们有关如何安装WordPress的教程。 一旦安装并设置了WordPress,就可以继续导入子站点。
步骤3:将子网站导入新域 (Step 3: Importing Child Site to New Domain)
Login to the WordPress admin area on the new location where you want to move your child site and then go to Tools » Import. On the import screen, WordPress will show you a number of import options.
登录到要移动子站点的新位置上的WordPress管理区域,然后转到“ 工具”»“导入” 。 在导入屏幕上,WordPress将为您显示许多导入选项。
You need to click on WordPress which will bring up a popup to install WordPress Importer plugin. Simply click on the Install Now button to start the installation. After that, you need to click on Activate Plugin & Run Importer.
您需要单击WordPress,这将弹出一个弹出窗口以安装WordPress Importer插件。 只需单击立即安装按钮即可开始安装。 之后,您需要点击激活插件并运行导入器 。
On the next screen, you will be asked to upload the WordPress export file you downloaded earlier from WordPress multisite in Step 1 of this tutorial.
在下一个屏幕上,将要求您上载本教程第1步中从WordPress多站点下载的WordPress导出文件。
WordPress will now ask if you would like to import users as well. If you do nothing, then WordPress will import all users which is recommended if you do not want to change authors.
WordPress现在会询问您是否也要导入用户。 如果您什么都不做,那么WordPress将导入所有用户,如果您不想更改作者,建议您这样做。
You will also see Import Attachments option, and you want to make sure it is checked so that WordPress can download images from your posts and pages (Don’t worry if it misses out some or most of your images. You can import them separately afterwards).
您还将看到“ 导入附件”选项,并且要确保选中该复选框,以便WordPress可以从您的帖子和页面下载图像(不要担心,如果它丢失了部分或大部分图像,则可以在以后分别导入它们) )。
WordPress will now start importing your content. This will take a few minutes depending on how much content you have. Once it is done, you will see an ‘All done, Have fun’ notification.
WordPress现在将开始导入您的内容。 这将需要几分钟,具体取决于您拥有多少内容。 完成后,您将看到“全部完成,玩得开心”的通知。
That’s all. You have successfully imported data from a multisite network child site to an individual WordPress install. There are still a few things left to do.
就这样。 您已成功将数据从多站点网络子站点导入到单个WordPress安装中。 还有一些事情要做。
步骤4:设定重新导向 (Step 4: Setting up Redirection)
If you were using custom domains for each site in your WordPress multisite network, then you don’t have to setup any redirection.
如果您为WordPress多站点网络中的每个站点使用自定义域,则无需设置任何重定向。
However if you were using subdomains or directory structure in your WordPress multisite, then you need to setup redirection, so that users coming to your old URLs are redirected to your new site.
但是,如果您在WordPress多站点中使用子域或目录结构,则需要设置重定向,以便将访问旧URL的用户重定向到新站点。
Make sure that your old site on the multisite network and the site on new domain both are using the same permalink structure.
确保多站点网络上的旧站点和新域上的站点都使用相同的永久链接结构 。
Redirecting From Subdomain to New Domain
从子域重定向到新域
For subdomain installs, you need to use this code in the .htaccess file of your WordPress multisite.
对于子域安装,您需要在WordPress多站点的.htaccess文件中使用此代码。
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^subdomain\.example\.com$ [NC]
RewriteRule ^(.*)$ http://www.example.net/$1 [L,R=301]
This code redirects visitors coming to any page on subdomain.example.com
to http://www.example.net
. The $1
sign at the end of the destination URL ensures that your users land on the same page they requested.
此代码将访问subdomain.example.com
上任何页面的访问者重定向到http://www.example.net
。 目标网址末尾的$1
符号可确保您的用户进入所需的同一页面。
Redirecting From Directory to New Domain
从目录重定向到新域
For directory based multisite installs, you will need to paste the following code in the .htaccess file of your WordPress multisite.
对于基于目录的多站点安装,您需要将以下代码粘贴到WordPress多站点的.htaccess文件中。
Options +FollowSymLinks
RewriteEngine On
RewriteRule ^childsite/(.*)$ http://example.net/$1 [R=301,L]
This code simply redirects any users coming on http://www.example.com/childsite/
to http://example.net
. The $1 makes sure that your users land on exactly the same page or post they requested.
此代码仅将http://www.example.com/childsite/
上的所有用户重定向到http://example.net
。 $ 1可以确保您的用户访问的网页完全相同。
Don’t forget to replace childsite and example.net with the name of your sub-site and its new location.
不要忘记用子站点的名称及其新位置替换childsite和example.net。
You can also use the Safe Redirect Manager plugin to setup redirection if you don’t like the code method.
如果您不喜欢代码方法,也可以使用安全重定向管理器插件来设置重定向。
步骤5:对迁移进行故障排除 (Step 5: Troubleshooting the Migration)
Moving a site is not a routine task, so it is likely that you will come across some issues. But don’t worry, there is solution for every issue that you may come across.
移动站点不是日常任务,因此您可能会遇到一些问题。 但是不用担心,您可能遇到的每个问题都有解决方案。
If your WordPress export file is too large, then you can split large XML file into smaller pieces.
如果您的WordPress导出文件太大,则可以将大型XML文件拆分成较小的部分。
If your images didn’t import correctly, then you can try importing them as external images.
如果您的图片无法正确导入,则可以尝试将其作为外部图片导入 。
See other common WordPress errors and how to fix them.
查看其他常见的WordPress错误以及如何修复它们。
That’s all, we hope this article helped you move a single site from your WordPress multisite network to it’s own individual WordPress install.
仅此而已,我们希望本文能帮助您将单个站点从WordPress多站点网络转移到它自己的单独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 Google+.
如果您喜欢这篇文章,请订阅我们的YouTube频道 WordPress视频教程。 您也可以在Twitter和Google+上找到我们。
wordpress 多站点