Wordpress plugin - can't find admin api key

Hi,

I installed the discourse plugin on wordpress its asking me for the admin api key, where do I find it ?

Thanks :slight_smile:

1 个赞

/admin/api

Or generate one from an admin user profile

I have installed the plugin but there’s nothing when I go to the URL, I thought maybe it needs to be done back end but I couldn’t find anything

1 个赞

You go to that URL on your Discourse forum not WordPress.

The discourse url is not yet setup as its asking for api key

To generate an API key go to yourdiscoursesite.com/admin/api. That is where you can generate an api key for the WordPress plugin. There will be a button that says generate key.

as I said the discourse site is not setup, plugin is installed but I can’t see discourse… It gives me a 404 page not found

The wp-discourse plugin acts as an interface between a WordPress site and a Discourse forum. To get it to work, you need to first set up both a WordPress site and a Discourse forum. You will find the admin api key in the admin section of your forum at ‘yourdiscoursesite.com/admin/api’.

The plugin’s documentation about this is not very clear. I’ll try to add to it later this week.

3 个赞

Hi Simon (@simon ),

Thanks for the reply, I did add it manually to composer.json is there anything else to do ?

I’m not sure. You need to have a Discourse forum up and running to connect to your WordPress site. If you haven’t done that, you can follow either of these guides to do it:

or:
discourse/docs/INSTALL-cloud.md at main · discourse/discourse · GitHub

Once that is done you need to go to the Discourse site at <yourforumdomain>/admin/api and click on the button to generate a new api key. Copy and paste the api key into the Discourse API Key setting on your WordPress site.

5 个赞

Okay Thanks I will try that … Much appreciated !

1 个赞

你好,我来接这个讨论并提个问题:我有一个 Discourse 站点和一个 WordPress 站点。那么,“所有用户”的 API 密钥与“仅限单个用户”的 API 密钥之间的区别是:

  • 所有用户:所有用户都可以查看并与 Discourse 和 WordPress 进行交互。
  • 单个用户:仅当该特定用户登录时,才能与 WordPress 和 Discourse 进行交互。
    我理解得对吗?
    如果生成一个适用于所有用户的 API 密钥并赋予其所有权限,会有什么风险?
    谢谢!

嘿 Yves,API 密钥仅用于建立连接。

一旦连接建立,任何具有发布权限的 WordPress 用户都可以将他们的帖子发布到 Discourse,具体取决于您的“发布”设置。

建议您为特定的管理员用户生成一个 API 密钥,并将其命名为“WordPress”。

4 个赞