Skip to content

WordPress 凭据(WordPress credentials)#

你可以使用以下凭据验证以下节点:

🌐 You can use these credentials to authenticate the following nodes:

先决条件(Prerequisites)#

支持的身份验证方法(Supported authentication methods)#

  • 基本身份验证
  • OAuth2

有关该服务的更多信息,请参阅 WordPress 的 API 文档

🌐 Refer to WordPress's API documentation for more information about the service.

使用基本身份验证(Using basic auth)#

要配置此凭据,你需要:

🌐 To configure this credential, you'll need:

  • 你的 WordPress 用户名
  • WordPress 应用 密码
  • 你的 WordPress 网址
  • 决定是否忽略 SSL 问题

使用此凭据涉及三个步骤:

🌐 Using this credential involves three steps:

  1. 启用两步验证
  2. 创建应用密码
  3. 设置凭据

请参阅以下各步骤的详细说明。

🌐 Refer to the detailed instructions below for each step.

启用两步身份验证(Enable two-step authentication)#

要生成应用密码,你必须先在 WordPress 中启用两步验证。如果你已经启用,请跳到下一部分

🌐 To generate an application password, you must first enable Two-Step Authentication in WordPress. If you've already done this, skip to the next section.

  1. 打开你的 WordPress 个人资料
  2. 从左侧菜单中选择 安全
  3. 选择两步验证两步验证页面将打开。
  4. 如果未启用双重身份验证,则必须启用它。
  5. 选择是否使用身份验证器应用或短信验证码启用此功能,并按照屏幕上的说明进行操作。

请参考 WordPress 的 启用两步验证 获取详细说明。

🌐 Refer to WordPress's Enable Two-Step Authentication for detailed instructions.

创建应用密码(Create an application password)#

启用双重身份验证后,你现在可以生成应用密码:

🌐 With Two-Step Authentication enabled, you can now generate an application password:

  1. 在 WordPress 安全 > 两步验证 页面,在 应用密码 部分选择 + 添加新的应用密码
  2. 输入一个应用名称,例如 n8n integration
  3. 选择 生成密码
  4. 复制它生成的密码。你将在 n8n 凭证中使用它。

设置凭据(Set up the credential)#

  1. 在你的 n8n 凭证中输入你的 WordPress 用户名
  2. 在你的 n8n 凭证中,将你上面复制的应用密码输入为 密码
  3. 将你的 WordPress 站点 URL 输入为 WordPress URL
  4. 可选:使用 忽略 SSL 问题 来选择是否希望 n8n 凭证在 SSL 证书验证失败时仍然连接(开启)或是否遵守 SSL 证书验证(关闭)。

使用 OAuth2(Using OAuth2)#

仅限 WordPress.com

OAuth2 认证仅适用于 WordPress.com 托管的网站。对于自托管的 WordPress,请改用基本身份验证。

要配置此凭据,你需要:

🌐 To configure this credential, you'll need:

  • A 客户端 ID:在你创建 WordPress.com 开发者应用时生成。
  • 一个 客户端密钥:在你创建 WordPress.com 开发者应用时生成。
  • 你的 WordPress.com 网站:你的 .wordpress.com 子域名或自定义域名(例如,myblog.wordpress.commyblog.com)。

创建此凭证涉及两个步骤:

🌐 Creating this credential involves two steps:

  1. 创建开发者应用
  2. 设置 OAuth2 凭据

创建开发者应用(Create a developer application)#

  1. 前往你的 WordPress.com 开发者应用 页面。
  2. 选择 创建新应用
  3. 为你的应用输入一个名称,例如 n8n integration
  4. 从 n8n 的 OAuth2(WordPress.com) 凭证界面复制 OAuth 重定向 URL。将其粘贴到 WordPress 的 重定向 URL 字段中。
  5. 根据你的应用填写描述网站网址及其他相关字段。
  6. 选择 创建 以保存应用。
  7. 返回你的 WordPress.com 开发者应用 页面,然后点击你刚创建的集成。
  8. 复制 客户端 ID客户端密钥

设置 OAuth2 凭证(Set up the OAuth2 credential)#

  1. 在 n8n OAuth2 (WordPress.com) 凭证屏幕上,粘贴上一环节获取的 客户端 ID客户端密钥
  2. WordPress.com 网站 字段中输入你的 WordPress.com 网站标识,例如,myblog.wordpress.com
  3. 点击 连接到 WordPress

有关更多信息,请参阅 WordPress 的 OAuth2 身份验证文档

🌐 Refer to WordPress's OAuth2 authentication documentation for more information.