Post by account_disabled on Dec 12, 2023 3:51:14 GMT -5
您想将您的网站添加到Google Search Console吗?但在 Google 开始抓取您的网站、查看您的统计信息或提交您的站点地图之前,系统会要求您验证该网站。 本质上,Google 的网站验证包括证明该网站属于您。因此,您需要先完成 Google Search Console 验证过程,然后才能使用 Google 工具管理网站。 幸运的是,这个过程非常简单,并且有多种方法可以使用 Google Search Console 验证您的网站。在本文中,我们将说明使用 Google 进行网站验证的九种不同方法,分为手动方法和使用 WordPress 插件: 开始吧! 验证 Google 网站的 5 种手动方法 如果您更喜欢使用 WordPress 插件通过 Google 验证您的网站,请单击此处直接跳转到该部分。 1.验证HTML文件 这些手动 Google 网站验证方法适用于所有网站,包括WordPress网站。 首先,请登录您的 Google Search Console 仪表板。从这里,您可以打开左侧的财产列表,然后单击“添加财产”以查看新网站: 将属性添加到 Google Search Console,并使用指向“添加属性”按钮的箭头。 将属性添加到 Google Search Console。 Search Console 会要求您选择资源类型。
您可以输入域或 URL 前缀。如果您输入域名,您将能够通过 DNS验证该网站。URL 前缀方 电话号码清单 法将允许您在四种验证方法之间进行选择: 使用以下选项在 Search Console 中选择媒体资源类型 在 Search Console 中选择媒体资源类型。 两种方法对于站点验证都有效。但是,我们建议使用URL 前缀方法,因为它提供了更多选项。 下一节将介绍可用于选择URL 前缀属性类型的四种验证方法。然后我们将在最后向您展示如何通过 DNS 验证您的网站(“域”选项)。继续并在URL 前缀下输入您的站点 URL,然后单击“继续”。 1. HTML验证文件 使用此方法,您需要将 HTML 文件上传到网站的根目录。这很简单,但缺点是您需要访问服务器才能上传文件,可以通过FTP/SFTP 客户端,或者使用cPanel 的文件管理器之类的工具。 第1步:下载验证文件 将您的网站添加到 Google Search Console 后,您应该会在“推荐的验证方法”选项卡中看到一个用于下载验证 HTML 文件的选项: 一个窗口显示从 Google Search Console 下载验证文件的选项。 从 Google Search Console 下载验证文件。 单击“下载文件”旁边的按钮。将此文件保存在您容易记住的地方 - 您很快就会需要它。
第2步:通过SFTP上传文件 现在您需要通过 FTP/SFTP连接到您的站点。以下是在 Kinsta 使用 SFTP 的说明。 成功连接后,将从 Google 下载的文件上传到站点的根文件夹(这是包含wp-content文件夹、 文件等的文件夹)。在 Kinsta,该文件夹称为public。 上传文件后,您应该看到如下内容: 打开的 SFTP 应用程序显示文件传输,并带有指向示件的箭头。 通过FTP/SFTP上传验证文件。 文件位于网站的根文件夹中后,返回 Google Search Console。是时候验证你的财产了。 第 3 步:点击 Google Search Console 中的验证按钮 将文件上传到网站后,返回 Google Search Console 并单击“检查”按钮以完成该过程。Google Search Console 将在您的服务器上找到该文件并验证您是否是该网站的所有者。 您可以按照相同的方法使用 Google Search Console 检查Kinsta 的内容分发网络 (CDN)。在 Google Search Console 上验证您的 CDN 将允许搜索引擎抓取您的图像并为其建立索引。 2.HTML标签 按照 HTML 标记方法,您需要将一个简单的元标记添加到站点的<head>部分。如果您使用WordPress,可以通过以下两种方式进行: 通过将标签直接添加到子主题的文件中 使用插件将其注入标头 我们将向您展示如何使用插件方法执行此操作,但只要您使用子主题,也可以将其直接添加到您的主题中(如果您不使用子主题,您将每次更新主题时都会丢失 Google 站点验证)。
您可以输入域或 URL 前缀。如果您输入域名,您将能够通过 DNS验证该网站。URL 前缀方 电话号码清单 法将允许您在四种验证方法之间进行选择: 使用以下选项在 Search Console 中选择媒体资源类型 在 Search Console 中选择媒体资源类型。 两种方法对于站点验证都有效。但是,我们建议使用URL 前缀方法,因为它提供了更多选项。 下一节将介绍可用于选择URL 前缀属性类型的四种验证方法。然后我们将在最后向您展示如何通过 DNS 验证您的网站(“域”选项)。继续并在URL 前缀下输入您的站点 URL,然后单击“继续”。 1. HTML验证文件 使用此方法,您需要将 HTML 文件上传到网站的根目录。这很简单,但缺点是您需要访问服务器才能上传文件,可以通过FTP/SFTP 客户端,或者使用cPanel 的文件管理器之类的工具。 第1步:下载验证文件 将您的网站添加到 Google Search Console 后,您应该会在“推荐的验证方法”选项卡中看到一个用于下载验证 HTML 文件的选项: 一个窗口显示从 Google Search Console 下载验证文件的选项。 从 Google Search Console 下载验证文件。 单击“下载文件”旁边的按钮。将此文件保存在您容易记住的地方 - 您很快就会需要它。
第2步:通过SFTP上传文件 现在您需要通过 FTP/SFTP连接到您的站点。以下是在 Kinsta 使用 SFTP 的说明。 成功连接后,将从 Google 下载的文件上传到站点的根文件夹(这是包含wp-content文件夹、 文件等的文件夹)。在 Kinsta,该文件夹称为public。 上传文件后,您应该看到如下内容: 打开的 SFTP 应用程序显示文件传输,并带有指向示件的箭头。 通过FTP/SFTP上传验证文件。 文件位于网站的根文件夹中后,返回 Google Search Console。是时候验证你的财产了。 第 3 步:点击 Google Search Console 中的验证按钮 将文件上传到网站后,返回 Google Search Console 并单击“检查”按钮以完成该过程。Google Search Console 将在您的服务器上找到该文件并验证您是否是该网站的所有者。 您可以按照相同的方法使用 Google Search Console 检查Kinsta 的内容分发网络 (CDN)。在 Google Search Console 上验证您的 CDN 将允许搜索引擎抓取您的图像并为其建立索引。 2.HTML标签 按照 HTML 标记方法,您需要将一个简单的元标记添加到站点的<head>部分。如果您使用WordPress,可以通过以下两种方式进行: 通过将标签直接添加到子主题的文件中 使用插件将其注入标头 我们将向您展示如何使用插件方法执行此操作,但只要您使用子主题,也可以将其直接添加到您的主题中(如果您不使用子主题,您将每次更新主题时都会丢失 Google 站点验证)。