WordPress

Manage posts, pages, users, comments, media, plugins, and settings in WordPress.

v1.0.0Source

Install

Manage WordPress posts, pages, users, categories, tags, comments, media, plugins, reusable blocks, menus, themes, and settings through the REST API. Use it to publish and sync site content.

WordPress@zerodot/wordpressInstall
  1. Open System, then Nodes.
  2. Find WordPress and click Install.
  3. Use the new nodes at once. You do not restart.

How it works

WordPress (wordpress.api) is an action node in the WordPress package (@zerodot/wordpress): Manage posts, pages, users, comments, media, plugins, and settings in WordPress.

The node uses the core REST API (/wp-json/wp/v2). The names of the fields follow the official API. The node uses camelCase names and sends snake_case names to WordPress.

  • Post: create, get, get many, update, delete
  • Page: create, get, get many, update, delete
  • User: create, get (also me), get many, update, delete
  • Category: create, get, get many, update, delete
  • Tag: create, get, get many, update, delete
  • Comment: create, get, get many, update, delete
  • Media: upload (create), get, get many, update, delete
  • Reusable Block (wp_block): create, get, get many, update, delete
  • Post Revision: get, get many, delete (for a post, a page, or a reusable block)
  • Autosave: create, get, get many (for a post, a page, or a reusable block)
  • Menu: create, get, get many, update, delete
  • Menu Item: create, get, get many, update, delete
  • Menu Location: get, get many
  • Application Password: create, get, get many, update, delete (for a user, or me)
  • Theme: get, get many
  • Plugin: install (inactive by default), get, get many, activate or deactivate (Update), delete
  • Settings: get, update (including url, site_logo, and site_icon)
  • Search: get many (the context is View or Embed)
  • Taxonomy, Post Type, Post Status: get, get many

Lists have Return All (at most 5000 items) and Limit. The node follows the pages with page and per_page (100 items for each page) and stops at the page count in the X-WP-TotalPages header. When a list has an Offset, the node moves the offset and does not use page. Use Filters to set the parameters of the list, such as search, after, before, author, exclude, include, order, orderby, slug, status, categories, and tags. Fields that take IDs or names take them with commas between. Use Additional Fields to set the optional fields of Create and Update. Use Context to get more fields (edit) or fewer fields (embed).

Notes:

  • Delete of a post, a page, a comment, or a reusable block moves the item to the trash. Turn on Delete For Good to delete it for good. A user, a category, a tag, a media item, and a revision cannot go to the trash, so the node always deletes them for good.
  • User > Delete takes Reassign To: the ID of the user that gets the posts of the deleted user. When it is empty, the node sends reassign=false and WordPress deletes the posts.
  • Plugin IDs are the plugin file without .php, for example akismet/akismet. A plugin must be inactive before you delete it. Install and delete of plugins need the install_plugins and delete_plugins rights. Some hosts block them.
  • The node does not send empty values. To clear a field, set it in WordPress.
  • Settings and other fields that the REST API shows only to users with the right need a user with that right.
  • Media > Upload reads the file from the binary property of the input (default data) and sends the raw bytes. File Name sets the name in WordPress. Without a file name the node uses the name of the input file. Title, alt text, caption, description, post, status, and author go in the query.
  • Password (Post, Page, Reusable Block, Comment get, Comment delete) is for protected posts.
  • Reusable Block has Sync Status (wp_pattern_sync_status) and Pattern Category IDs (wp_pattern_category).
  • Application Password > Create shows the new password one time, in the answer. Keep it.
  • A menu item with Target Same Tab sends an empty target.
  • WordPress core has no webhook API, so there is no trigger.

When WordPress gives an error, the node fails with the message, the details of the fields, the error code, and a short help text.

Logins it can use

WordPress application password (wordpress.applicationPassword): siteUrl (starts with http:// or https://), username, and applicationPassword. The password is secret. The node sends the login as HTTP Basic authentication. The node does not follow redirects. When the site redirects, the node fails with a message to use the final https address. When the site answers with HTML and not JSON (for example the home page), the node fails and tells you to check the site URL and the permalinks. The Test button reads the current user (/users/me?context=edit).

To make an application password, open Users > Profile in WordPress and use Application Passwords. WordPress 5.6 or higher is required. Use HTTPS: WordPress turns off application passwords on a site without HTTPS, unless it is a local site. The site must have pretty permalinks, or the /wp-json address must work.

Guides and related hubs