Setu Recipes: reusable workflows across every app.Browse templates

Integrations / WordPress.com

WordPress.com

WordPress.com sites: read your account, your sites and their posts.

4 actions OAuth 2 4 read0 write Calls public-api.wordpress.com

Connect

TypeScript
const conn = await setu.connections.initiate({ userId: "user_1", toolkit: "wordpress" });
console.log(conn.connectUrl); // show this to your user
await conn.waitUntilActive();

Permissions requested

ScopeWhy it is requested
globalAccess all of your WordPress.com sites

Actions

Get my WordPress.com profilereadwordpress.get_meGet the connected WordPress.com user's id, username, display name and primary site id.

Needs scope: global

No input.

TypeScript
await setu.execute({
  userId: "user_1",
  action: "wordpress.get_me",
  input: {},
});
Get postreadwordpress.get_postGet one post of a WordPress.com site, with its title, content, status and URL.

Needs scope: global

InputTypeDescription
sitestringRequiredSite id or domain
post_idintegerRequired
TypeScript
await setu.execute({
  userId: "user_1",
  action: "wordpress.get_post",
  input: {
    "site": "<site>",
    "post_id": 1
  },
});
List postsreadwordpress.list_postsList posts of a WordPress.com site by status, with optional text search and paging.

Needs scope: global

InputTypeDescription
sitestringRequiredSite id or domain, for example example.wordpress.com
statusstringOptional
searchstringOptional
numberintegerOptionalMax 100, default 20
pageintegerOptional1-indexed
order_bystringOptional
orderstringOptional
TypeScript
await setu.execute({
  userId: "user_1",
  action: "wordpress.list_posts",
  input: {
    "site": "<site>"
  },
});
List my sitesreadwordpress.list_sitesList the WordPress.com sites the connected user belongs to (ids and titles).

Needs scope: global

No input.

TypeScript
await setu.execute({
  userId: "user_1",
  action: "wordpress.list_sites",
  input: {},
});