WordPress.org Integration with SmythOS
Want to automate your self-hosted WordPress site? Connect your WordPress.org site to SmythOS and empower your agents to create, edit, and manage your posts programmatically using the WordPress REST API.
List of WordPress.org Components
Quickly compare WordPress.org components by what they do and their key I/O. Click any component name to jump directly to its detailed guide.
Component | Action | What it Does | Inputs | Key Outputs | Use Case |
---|---|---|---|---|---|
Create Draft Post | Write | Creates a new draft post with SEO metadata. | required domain_name , title , content | id | Staging an AI-generated article for review. |
Create Post With Image | Write | Creates a new draft post with a featured image. | required domain_name , title , content , image_id | id | Automating blog posts with visuals. |
Update Post | Write | Edits the content of an existing post. | required domain_name , post_id , content | id , content | Syncing content from an external source. |
List Posts | Read | Retrieves a list of posts from your site. | required domain_name optional per_page | posts | Getting recent articles for a dashboard. |
Get Post | Read | Retrieves a single post using its unique Post ID. | required domain_name , post_id | title , content | Fetching an article for analysis or re-purposing. |
Delete Post | Write | Permanently deletes a post from your site. | required domain_name , post_id | Response | Removing outdated content. |
Prerequisites
Before you begin, please ensure you have the following:
- An active SmythOS account. (Sign up here).
- A self-hosted WordPress.org site that is publicly accessible.
- An Administrator user account on your WordPress site.
- An Application Password generated for that user.
Getting Started With WordPress.org
The connection is handled via Basic Authentication, which requires a username and a special Application Password, combined and encoded in Base64 format.
Step 1: Generate an Application Password in WordPress
- Log in to your WordPress Dashboard as an Administrator.
- Navigate to Users > Profile.
- Scroll down to the Application Passwords section.
- Enter a new, descriptive name for your application (e.g., "SmythOS Agent") and click Add New Application Password.
- Copy the generated password immediately. It will not be shown again. This is your
app_password
.
Step 2: Encode Your Credentials in Base64
- Combine your WordPress username and the Application Password into a single string with a colon in between:
your_wp_username:your_app_password
. - Use a Base64 encoding tool (like the "Encode/Decode" component in SmythOS) to encode this string.
- Copy the resulting Base64 encoded string.
Step 3: Store Your Encoded Credentials in SmythOS Vault
Your encoded credentials are a sensitive secret. Use the SmythOS Vault
to store them securely.
- In your SmythOS dashboard, navigate to the Vault.
- Create a new secret and paste your Base64 encoded string as the value. Give it a memorable name, like
wordpress_org_auth
. - For more details, see the Vault Documentation.
Step 4: Configure a WordPress.org Component
- In your SmythOS agent graph, drag and drop any WordPress.org component.
- Click the component to open its Settings panel.
- In the
Base 64 encoded username and app password
field, select the secret you saved in the Vault. - Your connection is now configured for that component.
Which WordPress.org Component Should I Use?
If you need to… | Target | Use this Component | Why this one? |
---|---|---|---|
Create a new draft post with a featured image | domain_name , title , image_id | Create Post With Image | The best way to create visually rich posts programmatically. |
Update the body of an existing article | domain_name , post_id , content | Update Post | Modifies the content of an existing post without changing other attributes. |
Get the content of a specific post | domain_name , post_id | Get Post | The most direct way to retrieve a single post's full content and title. |
Get a list of your 10 most recent posts | domain_name | List Posts | Retrieves multiple posts at once, ideal for populating feeds or dashboards. |
Permanently delete an outdated article | domain_name , post_id | Delete Post | The standard way to securely remove content from your site via the API. |
Component Details
This section provides detailed information for each WordPress.org component.
Update Post
This component allows you to update the content of an existing post on a WordPress.org website.
Inputs
Field | Type | Required | Notes |
---|---|---|---|
domain_name | string | Yes | The URL of your WordPress site. |
post_id | string | Yes | The ID of the post you wish to update. |
content | string | Yes | The new text content of the post. Accepts raw text or HTML. |
Outputs
Field | Type | Description |
---|---|---|
id | integer | The unique identifier of the updated post. |
content | string | The updated content of the post. |
Response | object | The complete server response, including the updated post details. |
List Posts
This component retrieves a collection of posts from a WordPress.org site.
Inputs
Field | Type | Required | Notes |
---|---|---|---|
domain_name | string | Yes | The URL of your WordPress.org site. |
per_page | integer | Optional | The number of posts to retrieve per page. Defaults to 10 . |
Outputs
Field | Type | Description |
---|---|---|
posts | array | A list of posts retrieved in the specified format. |
Response | object | The entire server response including data about the retrieved posts. |
Headers | object | HTTP headers containing additional metadata from the response. |
Get Post
Retrieve a specific post from your WordPress.org site by accessing its detailed record.
Inputs
Field | Type | Required | Notes |
---|---|---|---|
domain_name | string | Yes | The URL of your WordPress.org site. |
post_id | string | Yes | The unique identifier of the post you wish to retrieve. |
Outputs
Field | Type | Description |
---|---|---|
title | string | The title of the post fetched. |
content | string | The main content or body of the post. |
link | string | Direct URL to the retrieved post. |
Response | object | Contains the full server response including metadata and post data. |
Create Draft Post
This component allows for the creation of a draft post on your WordPress.org site.
Inputs
Field | Type | Required | Notes |
---|---|---|---|
domain_name | string | Yes | The full URL of your WordPress.org site. |
title | string | Yes | The title of the draft post. |
content | string | Yes | The main text content of the draft post. Accepts raw text or HTML. |
meta_description | string | Optional | A brief summary of the post for SEO. |
keywords | string | Optional | Relevant SEO keywords associated with the post, separated by commas. |
categories | integer | Optional | The ID for the WordPress post category. |
Outputs
Field | Type | Description |
---|---|---|
id | integer | The unique identifier of the newly created draft post. |
Response | object | Provides the full server response including all metadata related to the draft post created. |
Create Post With Image
This component creates a draft post with a featured image attachment on your WordPress.org site.
Inputs
Field | Type | Required | Notes |
---|---|---|---|
domain_name | string | Yes | The URL of your WordPress.org site. |
title | string | Yes | The title of your post. |
content | string | Yes | The body of the post (plain text or HTML). |
meta_description | string | Optional | A concise SEO-friendly description of the post. |
keywords | string | Optional | Comma-separated keywords relevant to the post for SEO. |
image_id | string | Yes | The ID of an image already uploaded to your WordPress media library. |
Outputs
Field | Type | Description |
---|---|---|
id | integer | The unique identifier for the newly created draft post. |
Response | object | The complete server response, including all metadata related to the created draft post with an image. |
Delete Post
This component facilitates the deletion of a specific post from your WordPress.org site.
Inputs
Field | Type | Required | Notes |
---|---|---|---|
domain_name | string | Yes | The URL of your WordPress.org site where the post exists. |
post_id | string | Yes | The unique identifier of the post you wish to delete. |
Outputs
Field | Type | Description |
---|---|---|
Response | object | Displays the full server response, which includes confirmation of the deletion or details about any errors encountered. |
Headers | object | Lists HTTP headers that provide additional context about the response. |
Best Practices & Advanced Tips
- Secure Your Credentials: Your
username:app_password
string is a direct login. Always Base64 encode it and store the result in the SmythOSVault
. - Use Application Passwords: Never use your main user password for API access. Application Passwords are revocable and specific to an application, which is much more secure.
- Manage Media First: To create a post with an image, you must first ensure the image exists in your WordPress Media Library. This may require a separate agent step to upload the image via the REST API to get the
image_id
. - Update Status to Publish: The
Create Draft Post
component saves the post with adraft
status. To publish it, you must use theUpdate Post
component, providing thepost_id
and setting thestatus
topublish
in the request body.
Troubleshooting Common Issues
-
Error:
401 Unauthorized
- Cause: The Base64 encoded credentials are incorrect, or the user does not have sufficient permissions (must be an administrator or editor). The Application Password may have been revoked.
- Solution: Re-encode your
username:app_password
string and verify it. Ensure the user account has the appropriate role in WordPress. Generate a new Application Password if needed and update your Vault secret.
-
Error:
404 Not Found
- Cause: The
domain_name
is incorrect, or thepost_id
does not exist. - Solution: Check your domain for typos. Verify that the post you are trying to update or delete exists in your WordPress dashboard.
- Cause: The
-
Image Not Appearing in Post
- Cause: The
image_id
provided to theCreate Post With Image
component is incorrect or does not exist in the Media Library. - Solution: Confirm the image ID in your WordPress Media Library. Ensure the image was successfully uploaded before calling the component.
- Cause: The
What's Next?
You are now ready to build powerful content automations for your self-hosted WordPress site with the SmythOS WordPress.org Integration!
Consider these ideas:
-
Build an Agent That...
- Connects to your GitHub repository. When you merge a new Markdown file into a specific folder, the agent automatically converts it to HTML and creates a new draft post on your WordPress site.
- Generates a weekly newsletter. The agent uses
List Posts
to get the titles and links of all articles published in the last 7 days, formats them into an HTML email, and sends it using Resend. - Acts as a content translation pipeline. It takes an existing English post, sends the content to the Google Translate Integration, and then creates a new draft of the post in Spanish.
-
Explore Other Integrations:
- Use an LLM component to expand a short idea into a full blog post, then use
Create Draft Post
to save it for review. - After an agent creates a new post, it can take the post's title and use the Ayrshare Integration to announce it on your social media channels.
- Use an LLM component to expand a short idea into a full blog post, then use