wordpress 移站_如何轻松地将WordPress移至新域(不丢失SEO)

wordpress 移站

Do you want to move your WordPress site to a new domain? Changing your website’s domain name can significantly impact your SEO rankings, and it’s a process that needs to be done very carefully.

您想将WordPress网站移至新域吗? 更改您的网站域名可能会严重影响您的SEO排名,这一过程需要非常仔细地进行。

While you cannot avoid temporary SEO fluctuations when moving your website to a new domain, you can definitely minimize the impact and quickly regain your search traffic and rankings.

虽然在将网站移至新域时无法避免暂时的SEO波动,但是您绝对可以最大程度地减少影响,并快速重新获得搜索量和排名。

In this guide, we will show you the proper way to move WordPress to a new domain without losing SEO.

在本指南中,我们将向您展示在不丢失SEO的前提下将WordPress迁移到新域的正确方法。

Properly moving WordPress to another domain name

Here’s the 5 step process that we will cover to help you migrate your WordPress site to a new domain name:

这是我们将介绍的5个步骤,可帮助您将WordPress网站迁移到新域名:

  1. Create a Duplicator package of your WordPress site创建您的WordPress网站的复制程序包
  2. Create a database for new domain name为新域名创建数据库
  3. Unpack WordPress on new domain在新域上解压缩WordPress
  4. Setup Permanent 301 redirects设置永久301重定向
  5. Notify Google about the change通知Google有关更改
在你开始前 (Before You Start)

Before you start, we want to emphasize a few things.

在您开始之前,我们要强调一些事情。

The process of switching to a new domain will temporarily affect your search engine rankings as Google and other search engines adjust to the changes.

由于Google和其他搜索引擎会根据更改进行调整,因此切换到新域的过程将暂时影响您的搜索引擎排名。

Yes, this will also temporarily affect your search traffic as well. Please keep in mind that this is normal, and it happens to all websites that switch to a new domain.

是的,这也会暂时影响您的搜索流量。 请记住,这是正常现象,所有切换到新域的网站都会遇到这种情况。

However, you can dramatically decrease the SEO impact by following this guide. We will show you the right way of moving your WordPress site to a new domain name, setting up proper 301 redirects, and notifying search engines.

但是,通过遵循本指南,您可以大大降低SEO的影响。 我们会告诉你移动你的WordPress网站到一个新的域名,建立适当的301个重定向,并通知搜索引擎的正确方法

Please note that this guide is not for moving WordPress site to a new web host. This is for switching a domain name. Yes, while the process is similar, there are extra things involved in this process.

请注意,本指南不适用于将WordPress网站移至新的Web主机 。 这是用于切换域名。 是的,尽管该过程类似,但此过程中还涉及其他内容。

预备步骤 (Pre-Steps)

In this guide, we are assuming that you have your WordPress site setup on oldsite.com, and you are trying to migrate it to newsite.com.

在本指南中,我们假设您已在oldsite.com上安装了WordPress网站,并且正尝试将其迁移到newsite.com。

We are also assuming that you already have a web hosting account, and you are familiar with your web hosting control panel.

我们还假设您已经有一个虚拟主机帐户,并且您熟悉虚拟主机控制面板。

You will also need to know how to use FTP.

您还需要知道如何使用FTP

In case you don’t have a web hosting account, we recommend using Bluehost (great for small sites + comes with a free domain) or WP Engine (great for large sites).

如果您没有虚拟主机帐户,我们建议您使用Bluehost (小型网站非常适合+带有免费域)或WP Engine (大型网站非常适合)。

Once you have your new web hosting account and domain name, you’re ready to start the process.

拥有新的虚拟主机帐户和域名后,就可以开始该过程了。

步骤1:创建WordPress网站的复制程序包 (Step 1: Create a Duplicator package of Your WordPress Site)

The first thing you need to do is create a full backup of your WordPress site. While there are many WordPress backup plugins available, the one we’re going to show in this step does both backups and migrations.

您需要做的第一件事是创建WordPress网站的完整备份。 尽管有许多可用的WordPress备份插件 ,但我们将在此步骤中展示的插件既可以备份又可以迁移。

It’s Duplicator and it’s a completely free plugin.

它是Duplicator,并且是一个完全免费的插件。

Let’s start by installing and activating the Duplicator plugin on your old domain name. For more details, see our step by step guide on how to install a WordPress plugin.

首先,在您的旧域名上安装并激活Duplicator插件。 有关更多详细信息,请参阅有关如何安装WordPress插件的分步指南。

Once activated, the plugin will add a Duplicator menu item in your WordPress admin. You need to click on the Duplicator menu, and then click on the create button to create a new package.

激活后,该插件将在您的WordPress管理员中添加一个Duplicator菜单项。 您需要单击“复制器”菜单,然后单击“创建”按钮以创建一个新程序包。

Create a new Duplicator package

After that, you will be asked to click on the Next button to continue.

之后,将要求您单击下一步按钮以继续。

Duplicator will now run the website duplicator wizard. First, it will run some tests to see if everything is in order. If all items are marked ‘Good’, then click on the ‘Build’ button.

复制器现在将运行网站复制器向导。 首先,它将运行一些测试以查看是否一切正常。 如果所有项目都标记为“良好”,则单击“构建”按钮。

Build Duplicator package for switching to new domain name

The plugin will now start creating a duplicator package of your WordPress site. This process may take a few minutes depending on the size of your website.

该插件现在将开始创建WordPress网站的复制程序包。 此过程可能需要几分钟,具体取决于您网站的大小。

Once finished, you’ll see download options for Installer and the Archive package. You need to click on the ‘One click download’ link to download both files to your computer.

完成后,您将看到Installer和Archive软件包的下载选项。 您需要点击“一键下载”链接,将两个文件都下载到您的计算机上。

Download Duplicator package

The archive file is a complete copy of your website, and this will allow you to move WordPress to another domain name. The installer script will automate and run the migration by unpacking the archive file.

存档文件是您网站的完整副本,这将使您可以将WordPress移至另一个域名。 通过解压缩存档文件,安装程序脚本将自动执行并运行迁移。

步骤2.为新域名创建数据库 (Step 2. Create a Database for New Domain Name)

Before you can move, you’ll need a database to unpack WordPress on your new domain name.

在搬迁之前,您需要一个数据库来解压缩新域名上的WordPress。

If you have already created a database, then you can skip this step.

如果您已经创建了数据库,则可以跳过此步骤。

To create a database, you need to visit your hosting account’s cPanel dashboard, scroll down to the ‘Databases’ section, and then click on the ‘MySQL Databases’ icon.

要创建数据库,您需要访问托管帐户的cPanel仪表板,向下滚动到“数据库”部分,然后单击“ MySQL数据库”图标。

Database icon in CPanel

On the next screen, you’ll see a field to create a new database. Simply provide a name for your database and click on the ‘Create Database’ button.

在下一个屏幕上,您将看到一个用于创建新数据库的字段。 只需为您的数据库提供一个名称,然后单击“创建数据库”按钮。

Create database for switching to another domain name

cPanel will now create a new database for you. After that, you need to scroll down to the MySQL Users section.

cPanel现在将为您创建一个新的数据库。 之后,您需要向下滚动到“ MySQL用户”部分。

Next, provide a username and password for your new user and click on the ‘Create a user’ button.

接下来,为您的新用户提供用户名和密码,然后单击“创建用户”按钮。

Adding a new MySQL user

The new user you just created, still does not have permission to work on the database. Let’s change that.

您刚刚创建的新用户仍然没有权限在数据库上工作。 让我们改变它。

Scroll down to the ‘Add User to Database’ section. Simply select the database user you created from the dropdown menu next to the ‘User’ field, then select the database, and click on the add button.

向下滚动到“将用户添加到数据库”部分。 只需从“用户”字段旁边的下拉菜单中选择您创建的数据库用户,然后选择数据库,然后单击添加按钮。

Add user to database

Your database is now ready to be used on for moving WordPress to the new domain name. Make sure to note down the database name, username, and password. You’ll need this information in the next step.

您的数据库现已准备就绪,可用于将WordPress移至新域名。 确保记下数据库名称,用户名和密码。 下一步将需要此信息。

步骤3.在新域名上解压缩WordPress (Step 3. Unpacking WordPress on New Domain Name)

Now you need to upload the Duplicator files you downloaded earlier to your new domain name.

现在,您需要将先前下载的Duplicator文件上传到新域名。

First, connect to your domain name using an FTP client. Once connected, make sure that the root directory of your website is completely empty.

首先, 使用FTP客户端连接到您的域名。 连接后,请确保网站的根目录完全为空。

After that, you can upload the archive and installer files to the root directory.

之后,您可以将归档文件和安装程序文件上传到根目录。

Upload Duplicator files to new domain name

Once both files have finished uploading, you are now ready to unpack WordPress.

一旦两个文件都完成上传,您现在就可以解压缩WordPress。

Open a new browser tab and go to the following URL:

打开一个新的浏览器选项卡,然后转到以下URL:

http://example.com/installer.php

http://example.com/installer.php

Don’t forget to replace example.com with your new domain name. This will launch the Duplicator migration wizard.

不要忘了用新域名替换example.com。 这将启动Duplicator迁移向导。

Duplicator wizard

The installer will look for the archive file. You need to check the terms and conditions checkbox and click on the next button to continue.

安装程序将查找存档文件。 您需要选中条款和条件复选框,然后单击下一步按钮以继续。

Now, the installer will ask you to enter your WordPress database information.

现在,安装程序将要求您输入WordPress数据库信息。

Your host will likely be localhost. After that, you will enter the details of the database you created for your new domain name in the earlier step.

您的主机可能是本地主机。 之后,您将在上一步中输入为新域名创建的数据库的详细信息。

Connect to the database for your new domain name

Once done, click on the next button to continue.

完成后,单击下一步按钮继续。

Duplicator will now unpack your WordPress database backup from the archive into your new database.

现在,Duplicator将把您的WordPress数据库备份从存档中解压缩到新数据库中。

Next, it will ask you to update site URL or Path. You shouldn’t have to change anything since it automatically detects the URL of your new domain name and its path.

接下来,它将要求您更新站点URL或路径。 您无需更改任何内容,因为它会自动检测到新域名的URL及其路径。

If it doesn’t, then you can change the URL to your new domain name. After that, click on the next button to continue.

如果不是,则可以将URL更改为新域名。 之后,单击下一步按钮继续。

Update URL to your new domian name

Duplicator will now finish the migration.

复制器现在将完成迁移。

You can click on the ‘Admin Login’ button to enter the WordPress admin area of your website on the new domain name.

您可以单击“管理员登录”按钮,以新域名进入网站的WordPress管理区域。

Finishing WordPress migration to new domain name
步骤4.设置永久301重定向 (Step 4. Setting up Permanent 301 Redirects)

Setting up a permanent 301 redirect is very important for both SEO and user experience.

设置永久301重定向对于SEO和用户体验都非常重要。

This step will allow you to automatically redirect users and search engines to your new domain name.

此步骤将使您能够自动将用户和搜索引擎重定向到您的新域名。

In other words, whenever someone lands on one of your old posts or pages, they will be automatically redirected to your site on the new domain.

换句话说,只要有人登陆您的旧帖子或页面之一,他们就会自动重定向到新域上的您的网站。

To setup a permanent 301 redirect, you need to connect to your old site using FTP and edit the .htaccess file.

要设置永久的301重定向,您需要使用FTP连接到旧站点并编辑.htaccess文件

This will be located in the same directory as your wp-includes or wp-admin folder. Open the .htaccess file and paste the following code at the very top:

这将与wp-includes或wp-admin文件夹位于同一目录中。 打开.htaccess文件,并将以下代码粘贴到最顶部:


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

Note: Replace newsite.com with your new domain in the above code.

注意:在上述代码中,将newsite.com替换为您的新域。

Once you have applied these changes, then visit your old domain name. It should automatically redirect you to the new domain.

应用这些更改后,请访问您的旧域名。 它应该自动将您重定向到新域。

If it doesn’t, then it means the redirection is not setup properly, and your server likely doesn’t support redirect rules. You need to reach your web hosting’s support to get RewriteEngine turned on.

如果不正确,则意味着重定向设置不正确,并且您的服务器可能不支持重定向规则。 您需要获得虚拟主机的支持才能打开RewriteEngine。

第5步:通知Google有关更改 (Step 5. Notifying Google About the Change)

Now that you have moved WordPress to a new domain name and setup redirects, it is time to notify Google about the change of address. This will help Google find your new domain name quickly and start showing it in search results.

既然您已将WordPress移至新的域名并进行了设置重定向,那么现在该通知Google地址更改了。 这将帮助Google快速找到您的新域名,并将其开始显示在搜索结果中。

First, you need to add your new domain name to the Google Search Console. See step 1 in our Google Search Console guide for instructions.

首先,您需要将新域名添加到Google Search Console。 有关说明,请参见我们的Google Search Console指南中的第1步。

After you have added your new site, you need to switch to the old version of Google Search Console.

添加新站点后,需要切换到旧版本的Google Search Console。

Go to old version of Google Search Console

Next, you need to switch to your old domain name and then click on the gear icon at the top to launch change of address tool.

接下来,您需要切换到旧域名,然后单击顶部的齿轮图标以启动地址更改工具。

Change of address tool

On the next screen, Google Search Console will show you a step by step wizard to submit your change of address request.

在下一个屏幕上,Google Search Console将显示一个逐步向导,以提交更改地址的请求。

First it will ask you to select your new site from the drop down menu. After that, click on the check button to test 301 redirects and then confirm verification.

首先,它将要求您从下拉菜单中选择新站点。 之后,单击检查按钮以测试301重定向,然后确认验证。

Change of address for your old domain name

Finally, click on the submit button to send your address change request.

最后,单击提交按钮以发送您的地址更改请求。

通知用户有关移至新域名的信息 (Notify Users About the Move to New Domain Name)

While the 301 redirects do their job, it is always good to make a public announcement about the migration.

301重定向完成其工作时,最好公开发布有关迁移的信息。

You can do this by simply writing a blog post on your new site and sharing it on your social media accounts.

您只需在新网站上撰写博客文章,然后在您的社交媒体帐户上共享它即可。

If you have an email marketing list, then you should send a newsletter to let all your subscribers know.

如果您有电子邮件营销列表 ,则应发送新闻通讯,以告知所有订阅者。

This can be helpful in a lot of ways.

这可以在很多方面有所帮助。

First and foremost, your users are more likely to remember the new domain once they read about it.

首先,您的用户在阅读新域名时更容易记住它。

Second, you can ask your users to let you know if they see any bugs. You alone cannot test your site in all different type of browsers and system environments. It’s always helpful to have a fresh pair of eyes looking at it.

其次,您可以要求您的用户让他们知道是否发现任何错误。 一个人不能在所有不同类型的浏览器和系统环境中测试您的站点。 一双新鲜的眼睛看着它总是有帮助的。

We hope that this tutorial helped you move your WordPress site to a new domain name. You may also want to see our guide on how to track your search keyword rankings after moving to a new domain name.

我们希望本教程可以帮助您将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.

如果您喜欢这篇文章,请订阅我们的YouTube频道 WordPress视频教程。 您也可以在TwitterFacebook上找到我们。

翻译自: https://www.wpbeginner.com/wp-tutorials/how-to-properly-move-wordpress-to-a-new-domain-without-losing-seo/

wordpress 移站

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值