1. Overview
WordPress is a world-renowned open-source content management system (CMS). It allows you to create everything from simple blogs to complex websites and powerful applications.
With the GoInsight WordPress node, you can integrate your website's content and user management directly into your automated workflows. This enables you to programmatically control the core components of your WordPress site, including:
- Content Management: Automate the creation, retrieval, and updating of posts and pages.
- User Administration: Manage your user base by creating, finding, retrieving, and updating user profiles.
2. Prerequisites
Before using this node, you must have a self-hosted WordPress website (WordPress.org), not a site hosted on WordPress.com. You will also need administrator-level access to your WordPress dashboard to install plugins and generate the necessary Application Password for authentication.
3. Credentials
For a detailed guide on how to obtain and configure your credentials, please refer to our official documentation: Credential Configuration Guide.
4. Supported Operations
The WordPress node is organized around three primary resources: Pages, Posts, and Users. The summary below provides an overview of all supported operations.
Summary
Resource | Operation | Description |
---|---|---|
Page | Create a Page | Create a new WordPress page. |
Page | Find Pages | Retrieve a list of WordPress pages. |
Page | Get a Page | Retrieve detailed information for a single WordPress page. |
Page | Update a Page | Update an existing WordPress page. |
Post | Create a Post | Create a new WordPress post. |
Post | Find Posts | Retrieve a list of WordPress posts. |
Post | Get a Post | Retrieve detailed information for a single WordPress post. |
Post | Update a Post | Update an existing WordPress post. |
User | Create a User | Create a new WordPress user. |
User | Find Users | Retrieve a list of WordPress users. |
User | Get a User | Retrieve detailed information for a single WordPress user. |
User | Update a User | Update an existing WordPress user. |
Operation Details
Create a Page
Create a new WordPress page with full page properties support. Supports hierarchical structure, menu ordering, and comprehensive page management.
Options:
- Title: Page title, required parameter, supports HTML tags
- Content: Page content, supports HTML format, defaults to empty string
- Status: Page status, defaults to draft, valid values: publish, future, draft, pending, private
- Author: Author user ID, leave empty to use current authenticated user
- Excerpt: Page excerpt, used for SEO and page description
- Parent: Parent page ID, used to create page hierarchy
- MenuOrder: Menu order number, smaller numbers appear first
- FeaturedMedia: Featured image media ID
- CommentStatus: Comment status, valid values: open (enabled), closed (disabled)
- PingStatus: Ping status, valid values: open (enabled), closed (disabled)
Output:
- PageId (number): The ID of the created page
- PageUrl (string): The URL of the created page
- PageStatus (string): The status of the created page
- StatusCode (number): HTTP status code of the API response, -1 for parameter errors, 500 for exceptions
- ErrorMessage (string): Error message if an error occurs; empty string if successful
Find Pages
Retrieve a list of WordPress pages with flexible filtering and sorting options. Supports pagination, search, and multi-criteria filtering.
Options:
- Context: Context, optional, defaults to view, valid values: view, embed, edit
- Page: Current page number, optional, defaults to 1
- PerPage: Number of items per page, optional, defaults to 10, maximum 100
- Search: Search keywords, optional
- Author: Author ID, multiple separated by commas, optional
- Status: Page status, optional, defaults to publish, valid values: publish, future, draft, pending, private
- Parent: Parent page ID, multiple separated by commas, optional
- Order: Sort direction, optional, defaults to desc, valid values: asc, desc
- OrderBy: Sort field, optional, defaults to date, valid values: author, date, id, include, modified, parent, relevance, slug, title, menu_order
Output:
- PagesList (object-array): Array of page data objects matching the search criteria
- TotalPages (number): Total number of pages matching the criteria
- TotalPagesCount (number): Total number of result pages available
- CurrentPage (number): Current page number
- StatusCode (number): HTTP status code of the API response, -1 for parameter errors, 500 for exceptions
- ErrorMessage (string): Error message if an error occurs; empty string if successful
Get a Page
Retrieve detailed information for a single WordPress page by ID. Supports different contexts and password-protected pages.
Options:
- PageId: ID of the page to retrieve
- Context: Context, optional, defaults to view, options: view, embed, edit
- PostPassword: Password for password-protected page, optional
Output:
- PageData (object): Complete page data including all page fields and metadata
- StatusCode (number): HTTP status code of the API response, -1 for parameter errors, 500 for exceptions
- ErrorMessage (string): Error message if an error occurs; empty string if successful
Update a Page
Update an existing WordPress page with flexible field modification support. Allows partial updates and comprehensive page management.
Options:
- PageId: ID of the page to update
- Title: Page title, optional
- Content: Page content, optional
- Status: Page status, optional, valid values: publish, future, draft, pending, private
- Author: Author ID, optional
- Excerpt: Page excerpt, optional
- Parent: Parent page ID, optional
- MenuOrder: Menu order, optional
- FeaturedMedia: Featured media ID, optional
- CommentStatus: Comment status, optional, valid values: open, closed
- PingStatus: Ping status, optional, valid values: open, closed
Output:
- PageId (number): The ID of the updated page
- PageUrl (string): The URL of the updated page
- PageStatus (string): The current status of the updated page
- UpdatedFields (string-array): List of fields that were successfully updated
- StatusCode (number): HTTP status code of the API response, -1 for parameter errors, 500 for exceptions
- ErrorMessage (string): Error message if an error occurs; empty string if successful
Create a Post
Create a new WordPress post with comprehensive content management features. Supports rich text, categories, tags, and flexible status management.
Options:
- Title: Post title, required parameter, supports HTML tags
- Content: Post content, supports HTML format, defaults to empty string
- Status: Post status, defaults to draft, valid values: publish, future, draft, pending, private
- Author: Author user ID, leave empty to use current authenticated user
- Excerpt: Post excerpt, used for display in article lists
- Categories: Category ID list, multiple categories separated by commas, like 1,5,10
- Tags: Tag ID list, multiple tags separated by commas, like 2,8,15
- FeaturedMedia: Featured image media ID
Output:
- PostId (number): The ID of the created post
- PostUrl (string): The URL of the created post
- PostStatus (string): The status of the created post
- StatusCode (number): HTTP status code of the API response, -1 for parameter errors, 500 for exceptions
- ErrorMessage (string): Error message if an error occurs; empty string if successful
Find Posts
Retrieve a list of WordPress posts with comprehensive filtering and sorting capabilities. Supports multi-criteria search, pagination, and flexible query combinations.
Options:
- Context: Access context, defaults to view, valid values: view, embed, edit
- Page: Current page number, defaults to 1, must be a positive integer
- PerPage: Number of items per page, defaults to 10, maximum value is 100
- Search: Search keywords, performs full-text search in titles and content
- Author: Author user ID, multiple IDs separated by commas, like 1,5,10
- Status: Post status filter, valid values: publish, future, draft, pending, private
- Categories: Category ID filter, multiple IDs separated by commas, like 1,5,10
- Tags: Tag ID filter, multiple IDs separated by commas, like 2,8,15
- Order: Sort direction, defaults to desc, valid values: asc, desc
- OrderBy: Sort field, defaults to date, valid values: author, date, id, include, modified, parent, relevance, slug, title
Output:
- PostsList (object): Array of post data objects matching the search criteria
- TotalPosts (number): Total number of posts matching the criteria
- TotalPages (number): Total number of pages available
- CurrentPage (number): Current page number
- StatusCode (number): HTTP status code of the API response, -1 for parameter errors, 500 for exceptions
- ErrorMessage (string): Error message if an error occurs; empty string if successful
Get a Post
Retrieve detailed information for a single WordPress post by ID. Supports different access contexts and password-protected posts.
Options:
- PostId: ID of the post to retrieve, must be a valid numeric string
- Context: Access context, defaults to view, valid values: view, embed, edit
- PostPassword: Password for password-protected posts, used to access protected content
Output:
- PostData (object): Complete post data including all post fields and metadata
- StatusCode (number): HTTP status code of the API response, -1 for parameter errors, 500 for exceptions
- ErrorMessage (string): Error message if an error occurs; empty string if successful
Update a Post
Update an existing WordPress post with flexible field modification capabilities. Supports partial updates and comprehensive post management.
Options:
- PostId: ID of the post to update, must be a valid numeric string
- Title: New post title, leave empty to skip update
- Content: New post content, supports HTML, leave empty to skip update
- Status: New post status, leave empty to skip update, valid values: publish, future, draft, pending, private
- Author: New author user ID, leave empty to skip update
- Excerpt: New post excerpt, leave empty to skip update
- Categories: New category ID list, comma separated like 1,5,10, leave empty to skip update
- Tags: New tag ID list, comma separated like 2,8,15, leave empty to skip update
- FeaturedMedia: New featured media ID, leave empty to skip update
Output:
- PostId (number): The ID of the updated post
- PostUrl (string): The URL of the updated post
- PostStatus (string): The current status of the updated post
- UpdatedFields (string-array): List of fields that were successfully updated
- StatusCode (number): HTTP status code of the API response, -1 for parameter errors, 500 for exceptions
- ErrorMessage (string): Error message if an error occurs; empty string if successful
Create a User
Create a new WordPress user with complete user management features. Supports user roles, profile information, and customizable user attributes.
Options:
- Username: Username for the user to create
- Email: Email address for the user to create
- Password: Password for the user to create
- Name: User display name, optional
- FirstName: User first name, optional
- LastName: User last name, optional
- Url: User website URL, optional
- Description: User description, optional
- Locale: User locale, optional, valid values: empty or en_US
- Nickname: User nickname, optional
- Slug: User slug, optional
- Roles: User roles, multiple separated by commas, optional
Output:
- UserId (number): The ID of the created user
- UserLogin (string): The login username of the created user
- UserEmail (string): The email of the created user
- UserName (string): The display name of the created user
- UserSlug (string): The slug of the created user
- StatusCode (number): HTTP status code of the API response, -1 for parameter errors, 500 for exceptions
- ErrorMessage (string): Error message if an error occurs; empty string if successful
Find Users
Retrieve a list of WordPress users with advanced filtering and sorting options. Supports role-based filtering, search, and comprehensive user management.
Options:
- Context: Context, optional, defaults to view, valid values: view, embed, edit
- Page: Current page number, optional, defaults to 1
- PerPage: Number of items per page, optional, defaults to 10
- Search: Search keywords, optional
- Exclude: User IDs to exclude, multiple separated by commas, optional
- Include: User IDs to include, multiple separated by commas, optional
- Order: Sort direction, optional, defaults to asc, valid values: asc, desc
- OrderBy: Sort field, optional, defaults to name, valid values: id, include, name, registered_date, slug, include_slugs, email, url
- Slug: User slug filter, multiple separated by commas, optional
- Roles: User role filter, multiple separated by commas, optional
- Capabilities: User capabilities filter, multiple separated by commas, optional
- Who: Limit results to authors, optional, valid value: authors
- HasPublishedPosts: Filter users based on whether they have published posts, optional, valid values: true, false
Output:
- UsersList (object-array): Array of user data objects matching the search criteria
- TotalUsers (number): Total number of users matching the criteria
- TotalPages (number): Total number of pages available
- CurrentPage (number): Current page number
- StatusCode (number): HTTP status code of the API response, -1 for parameter errors, 500 for exceptions
- ErrorMessage (string): Error message if an error occurs; empty string if successful
Get a User
Retrieve detailed information for a single WordPress user by ID. Supports different access contexts for comprehensive user data.
Options:
- UserId: ID of the user to retrieve
- Context: Context, optional, defaults to view, valid values: view, embed, edit
Output:
- UserData (object): Complete user data including profile information, roles, and metadata
- StatusCode (number): HTTP status code of the API response, -1 for parameter errors, 500 for exceptions
- ErrorMessage (string): Error message if an error occurs; empty string if successful
Update a User
Update an existing WordPress user with comprehensive profile management capabilities. Supports partial updates and flexible user attribute modification.
Options:
- UserId: ID of the user to update
- Username: Username, optional
- Email: User email, optional
- Password: User password, optional
- Name: Display name, optional
- FirstName: First name, optional
- LastName: Last name, optional
- Url: User website URL, optional
- Description: User description, optional
- Locale: User locale, optional
- Nickname: User nickname, optional
- Slug: User slug, optional
- Roles: User roles, optional, can be multiple
Output:
- UserId (number): The ID of the updated user
- UserLogin (string): The login username of the updated user
- UserEmail (string): The email of the updated user
- UserName (string): The display name of the updated user
- UserSlug (string): The slug of the updated user
- UpdatedFields (string-array): List of fields that were successfully updated
- StatusCode (number): HTTP status code of the API response, -1 for parameter errors, 500 for exceptions
- ErrorMessage (string): Error message if an error occurs; empty string if successful
5. Example Usage
This section will guide you through creating a simple workflow to publish a new blog post on your WordPress site.
The workflow will look like this: Start -> Create a Post -> Answer.
Step-by-Step Guide
- Add the Tool Node:
- In the workflow canvas, click the + icon to add a new node.
- Select the "Tool" tab in the pop-up panel.
- Find and select WordPress from the tool list.
- In the list of supported operations for WordPress, click Create a Post to add the corresponding node to the canvas.
- Configure the Node:
- Click on the newly added Create a Post node to open its configuration panel on the right.
- Credentials: In the credentials field at the top of the panel, click the dropdown menu and select your pre-configured WordPress credential.
- Parameters: Fill in the input parameters for the post.
- Title: Enter a title for your new post, for example, "My First Automated Post".
- Content: Write the body of your post. You can use HTML for formatting, for example,
This is the content of my first post published via GoInsight!
. - Status: To publish the post immediately, enter publish.
- Run and Validate:
- Once all required parameters are correctly filled, the error indicators on the workflow canvas will disappear.
- Click the "Run" button in the top-right corner of the canvas to execute the workflow.
- After a successful execution, you can click the log icon in the top-right corner to view the detailed input and output of the node. The output will contain the ID and URL of your new post.
Final Workflow
After completing these steps, your workflow is fully configured. When you run it, a new post will be published on your WordPress website.
6. FAQs
Q: Why am I getting a "401 rest_cannot_create" error?
A: This error usually indicates that your user account does not have sufficient permissions to perform the action (e.g., create a post or user). Please check the following in your WordPress dashboard:
- Ensure the user account associated with your Application Password has the correct role (e.g., Editor or Administrator).
- Verify that the role has the necessary capabilities to create or edit the content you are targeting.
Q: My request is failing. How do I get the Application Password?
A: You need to generate an Application Password from your WordPress admin dashboard. Go to Users -> Profile, and scroll down to the "Application Passwords" section. Enter a name for the application (e.g., "GoInsight") and click "Add New Application Password". Use the generated password in your GoInsight credential configuration. Note that you must have a plugin like "Application Passwords" or be on a recent version of WordPress that includes this feature.
Q: How do I find the ID for a category or tag?
A: You can find the ID for categories and tags in the WordPress admin dashboard. When you go to Posts -> Categories (or Tags), hover over a category/tag and look at the URL in your browser's status bar. The URL will contain tag_ID=X, where X is the ID you need.
7. Official Documentation
For more in-depth information about the WordPress REST API, please refer to the official Developer Handbook:
Leave a Reply.