> Markdown versions of all pages of this connector library are available by appending `.md` to the page URL. For the full index of connectors, see [llms.txt](https://connectors.appmixer.com/llms.txt).

# appmixer.wordpress.posts.CreatePost

- Component: `appmixer.wordpress.posts.CreatePost`
- Kind: Action
- Version: 1.0.0
- Visibility: Public
- Connector: [appmixer.wordpress 1.3.5](https://connectors.appmixer.com/connector/appmixer.wordpress/1.3.5.md)
- Component page: <https://connectors.appmixer.com/connector/appmixer.wordpress/1.3.5/component/appmixer.wordpress.posts.CreatePost>

This component creates a new post.

## Properties

| Field | Type | Description |
| --- | --- | --- |
| Site (`siteId`) | text | Select site. |
| Author (`author`) | text | The username or ID for the user to assign the post to. |

## Input ports

### Port `post`

| Field | Type | Description |
| --- | --- | --- |
| Title (`title`) | text | The post title. |
| Content (`content`) | textarea | The post content. |
| Date (`date`) | date-time | The post's creation time. |
| Excerpt (`excerpt`) | textarea | An optional post excerpt. |
| Slug (`slug`) | text | The name (slug) for the post, used in URLs. |
| Publicize (`publicize`) | toggle | Turn it on to publicize post to external services. |
| Publicize message (`publicizeMessage`) | text | Custom message to be publicized to external services. |
| Status (`status`) | select | Specifies what type of post status you would prefer. _publish_ publish the post, _private_ - privately publish the post, _draft_ - save the post as a draft, _pending_ - mark the post as pending editorial approval, _auto-draft_ - save a placeholder for a newly created post, with no content. |
| Sticky (`sticky`) | toggle | Turn it on to mark post as sticky (stick post to the front page). |
| Password (`password`) | text | The plaintext password protecting the post, or, more likely, the empty string if the post is not password protected. |
| Format (`format`) | select | Specifies what type of post format you would prefer. |
| Likes enabled (`likesEnabled`) | toggle | Turn it on to open the post to likes. |
| Sharing enabled (`sharingEnabled`) | toggle | Turn it on to show sharing buttons for this post. |

## Output ports

### Port `newPost`

| Field | Type | Description |
| --- | --- | --- |
| `ID` | integer | - |
| `URL` | string | - |
| `attachment_count` | integer | - |
| `author.ID` | integer | - |
| `author.URL` | string | - |
| `author.avatar_URL` | string | - |
| `author.email` | string,boolean | - |
| `author.first_name` | string | - |
| `author.last_name` | string | - |
| `author.login` | string | - |
| `author.name` | string | - |
| `author.name` | string | - |
| `author.profile_URL` | string | - |
| `author.site_ID` | integer | - |
| `capabilities.delete_post` | boolean | - |
| `capabilities.edit_post` | boolean | - |
| `capabilities.publish_post` | boolean | - |
| `content` | string | - |
| `date` | string | - |
| `discussion.comments_open` | boolean | - |
| `discussion.comment_count` | integer | - |
| `discussion.comment_status` | string | - |
| `discussion.pings_open` | boolean | - |
| `discussion.ping_status` | string | - |
| `excerpt` | string | - |
| `featured_image` | string | - |
| `format` | string | - |
| `geo` | boolean,object | - |
| `global_ID` | string | - |
| `guid` | string | - |
| `is_following` | boolean | - |
| `is_reblogged` | boolean | - |
| `i_like` | boolean | - |
| `likes_enabled` | boolean | - |
| `like_count` | integer | - |
| `menu_order` | integer | - |
| `meta.links.help` | string | - |
| `meta.links.likes` | string | - |
| `meta.links.replies` | string | - |
| `meta.links.self` | string | - |
| `meta.links.site` | string | - |
| `metadata` | array,boolean | - |
| `modified` | string | - |
| `page_template` | string | - |
| `parent` | boolean,object | - |
| `password` | string | - |
| `post_thumbnail` | object,null | - |
| `sharing_enabled` | boolean | - |
| `short_URL` | string | - |
| `site_ID` | integer | - |
| `slug` | string | - |
| `status` | string | - |
| `sticky` | boolean | - |
| `title` | string | - |
| `type` | string | - |

## Full metadata (component.json)

```json
{
  "name": "appmixer.wordpress.posts.CreatePost",
  "author": "Tomasz Hencel <thencel@ntrc.eu>",
  "description": "This component creates a new post.",
  "private": false,
  "auth": {
    "service": "appmixer:wordpress",
    "scope": [
      "global"
    ]
  },
  "inPorts": [
    {
      "name": "post",
      "schema": {
        "type": "object",
        "properties": {
          "date": {
            "oneOf": [
              {
                "$ref": "#/definitions/Date"
              },
              {
                "$ref": "#/definitions/DateTime"
              }
            ]
          },
          "title": {
            "type": "string"
          },
          "content": {
            "type": "string"
          },
          "excerpt": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "publicize": {
            "type": "boolean"
          },
          "publicizeMessage": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "sticky": {
            "type": "boolean"
          },
          "password": {
            "type": "string"
          },
          "format": {
            "type": "string"
          },
          "likesEnabled": {
            "type": "boolean"
          },
          "sharingEnabled": {
            "type": "boolean"
          }
        },
        "required": [
          "title",
          "content"
        ],
        "definitions": {
          "Date": {
            "type": "string",
            "pattern": "^[0-9]{4}-[0|1][0-9]-[0-3][0-9]$"
          },
          "DateTime": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "inspector": {
        "inputs": {
          "title": {
            "type": "text",
            "tooltip": "The post title.",
            "label": "Title",
            "index": 1
          },
          "content": {
            "type": "textarea",
            "tooltip": "The post content.",
            "label": "Content",
            "index": 2
          },
          "date": {
            "type": "date-time",
            "tooltip": "The post's creation time.",
            "label": "Date",
            "index": 3
          },
          "excerpt": {
            "type": "textarea",
            "tooltip": "An optional post excerpt.",
            "label": "Excerpt",
            "index": 4
          },
          "slug": {
            "type": "text",
            "tooltip": "The name (slug) for the post, used in URLs.",
            "label": "Slug",
            "index": 5
          },
          "publicize": {
            "type": "toggle",
            "index": 6,
            "label": "Publicize",
            "defaultValue": true,
            "tooltip": "Turn it on to publicize post to external services."
          },
          "publicizeMessage": {
            "type": "text",
            "tooltip": "Custom message to be publicized to external services.",
            "label": "Publicize message",
            "index": 7
          },
          "status": {
            "type": "select",
            "options": [
              "publish",
              "private",
              "draft",
              "pending",
              "auto-draft"
            ],
            "defaultValue": "publish",
            "index": 8,
            "label": "Status",
            "tooltip": "Specifies what type of post status you would prefer. <i>publish</i> publish the post, <i>private</i> - privately publish the post, <i>draft</i> - save the post as a draft, <i>pending</i> - mark the post as pending editorial approval, <i>auto-draft</i> - save a placeholder for a newly created post, with no content. "
          },
          "sticky": {
            "type": "toggle",
            "index": 9,
            "label": "Sticky",
            "defaultValue": false,
            "tooltip": "Turn it on to mark post as sticky (stick post to the front page)."
          },
          "password": {
            "type": "text",
            "tooltip": "The plaintext password protecting the post, or, more likely, the empty string if the post is not password protected.",
            "label": "Password",
            "index": 10
          },
          "format": {
            "type": "select",
            "options": [
              "default",
              "standard",
              "aside",
              "chat",
              "gallery",
              "link",
              "image",
              "quote",
              "status",
              "video",
              "audio"
            ],
            "defaultValue": "default",
            "index": 11,
            "label": "Format",
            "tooltip": "Specifies what type of post format you would prefer."
          },
          "likesEnabled": {
            "type": "toggle",
            "index": 12,
            "label": "Likes enabled",
            "defaultValue": true,
            "tooltip": "Turn it on to open the post to likes."
          },
          "sharingEnabled": {
            "type": "toggle",
            "index": 13,
            "label": "Sharing enabled",
            "defaultValue": true,
            "tooltip": "Turn it on to show sharing buttons for this post."
          }
        }
      }
    }
  ],
  "outPorts": [
    {
      "name": "newPost",
      "options": [
        {
          "label": "ID",
          "value": "ID",
          "schema": {
            "type": "integer",
            "example": 1042
          }
        },
        {
          "label": "URL",
          "value": "URL",
          "schema": {
            "type": "string",
            "example": "https://acmeblog.wordpress.com/2026/09/10/hello-automation/"
          }
        },
        {
          "label": "attachment_count",
          "value": "attachment_count",
          "schema": {
            "type": "integer",
            "example": 1
          }
        },
        {
          "label": "author.ID",
          "value": "author.ID",
          "schema": {
            "type": "integer",
            "example": 12345678
          }
        },
        {
          "label": "author.URL",
          "value": "author.URL",
          "schema": {
            "type": "string",
            "example": "https://acmeblog.wordpress.com"
          }
        },
        {
          "label": "author.avatar_URL",
          "value": "author.avatar_URL",
          "schema": {
            "type": "string",
            "example": "https://0.gravatar.com/avatar/a8f5f167f44f4964e6c998dee827110c?s=96&d=identicon&r=G"
          }
        },
        {
          "label": "author.email",
          "value": "author.email",
          "schema": {
            "type": [
              "string",
              "boolean"
            ],
            "example": false
          }
        },
        {
          "label": "author.first_name",
          "value": "author.first_name",
          "schema": {
            "type": "string",
            "example": "Jane"
          }
        },
        {
          "label": "author.last_name",
          "value": "author.last_name",
          "schema": {
            "type": "string",
            "example": "Doe"
          }
        },
        {
          "label": "author.login",
          "value": "author.login",
          "schema": {
            "type": "string",
            "example": "janedoe"
          }
        },
        {
          "label": "author.name",
          "value": "author.name",
          "schema": {
            "type": "string",
            "example": "Jane Doe"
          }
        },
        {
          "label": "author.name",
          "value": "author.name",
          "schema": {
            "type": "string",
            "example": "Jane Doe"
          }
        },
        {
          "label": "author.profile_URL",
          "value": "author.profile_URL",
          "schema": {
            "type": "string",
            "example": "https://gravatar.com/janedoe"
          }
        },
        {
          "label": "author.site_ID",
          "value": "author.site_ID",
          "schema": {
            "type": "integer",
            "example": 123456789
          }
        },
        {
          "label": "capabilities.delete_post",
          "value": "capabilities.delete_post",
          "schema": {
            "type": "boolean",
            "example": true
          }
        },
        {
          "label": "capabilities.edit_post",
          "value": "capabilities.edit_post",
          "schema": {
            "type": "boolean",
            "example": true
          }
        },
        {
          "label": "capabilities.publish_post",
          "value": "capabilities.publish_post",
          "schema": {
            "type": "boolean",
            "example": true
          }
        },
        {
          "label": "content",
          "value": "content",
          "schema": {
            "type": "string",
            "example": "<p>Here is how we automated our weekly reporting.</p>"
          }
        },
        {
          "label": "date",
          "value": "date",
          "schema": {
            "type": "string",
            "example": "2026-09-10T10:30:00+02:00"
          }
        },
        {
          "label": "discussion.comments_open",
          "value": "discussion.comments_open",
          "schema": {
            "type": "boolean",
            "example": true
          }
        },
        {
          "label": "discussion.comment_count",
          "value": "discussion.comment_count",
          "schema": {
            "type": "integer",
            "example": 0
          }
        },
        {
          "label": "discussion.comment_status",
          "value": "discussion.comment_status",
          "schema": {
            "type": "string",
            "example": "open"
          }
        },
        {
          "label": "discussion.pings_open",
          "value": "discussion.pings_open",
          "schema": {
            "type": "boolean",
            "example": true
          }
        },
        {
          "label": "discussion.ping_status",
          "value": "discussion.ping_status",
          "schema": {
            "type": "string",
            "example": "open"
          }
        },
        {
          "label": "excerpt",
          "value": "excerpt",
          "schema": {
            "type": "string",
            "example": "<p>Here is how we automated our weekly reporting.</p>"
          }
        },
        {
          "label": "featured_image",
          "value": "featured_image",
          "schema": {
            "type": "string",
            "example": "https://acmeblog.files.wordpress.com/2026/09/cover.jpg"
          }
        },
        {
          "label": "format",
          "value": "format",
          "schema": {
            "type": "string",
            "example": "standard"
          }
        },
        {
          "label": "geo",
          "value": "geo",
          "schema": {
            "type": [
              "boolean",
              "object"
            ],
            "example": false
          }
        },
        {
          "label": "global_ID",
          "value": "global_ID",
          "schema": {
            "type": "string",
            "example": "7e2f1b3d9c4a5e6f8a0b1c2d3e4f5a6b"
          }
        },
        {
          "label": "guid",
          "value": "guid",
          "schema": {
            "type": "string",
            "example": "https://acmeblog.wordpress.com/?p=1042"
          }
        },
        {
          "label": "is_following",
          "value": "is_following",
          "schema": {
            "type": "boolean",
            "example": false
          }
        },
        {
          "label": "is_reblogged",
          "value": "is_reblogged",
          "schema": {
            "type": "boolean",
            "example": false
          }
        },
        {
          "label": "i_like",
          "value": "i_like",
          "schema": {
            "type": "boolean",
            "example": false
          }
        },
        {
          "label": "likes_enabled",
          "value": "likes_enabled",
          "schema": {
            "type": "boolean",
            "example": true
          }
        },
        {
          "label": "like_count",
          "value": "like_count",
          "schema": {
            "type": "integer",
            "example": 0
          }
        },
        {
          "label": "menu_order",
          "value": "menu_order",
          "schema": {
            "type": "integer",
            "example": 0
          }
        },
        {
          "label": "meta.links.help",
          "value": "meta.links.help",
          "schema": {
            "type": "string",
            "example": "https://public-api.wordpress.com/rest/v1.1/sites/123456789/posts/1042/help"
          }
        },
        {
          "label": "meta.links.likes",
          "value": "meta.links.likes",
          "schema": {
            "type": "string",
            "example": "https://public-api.wordpress.com/rest/v1.1/sites/123456789/posts/1042/likes/"
          }
        },
        {
          "label": "meta.links.replies",
          "value": "meta.links.replies",
          "schema": {
            "type": "string",
            "example": "https://public-api.wordpress.com/rest/v1.1/sites/123456789/posts/1042/replies/"
          }
        },
        {
          "label": "meta.links.self",
          "value": "meta.links.self",
          "schema": {
            "type": "string",
            "example": "https://public-api.wordpress.com/rest/v1.1/sites/123456789/posts/1042"
          }
        },
        {
          "label": "meta.links.site",
          "value": "meta.links.site",
          "schema": {
            "type": "string",
            "example": "https://public-api.wordpress.com/rest/v1.1/sites/123456789"
          }
        },
        {
          "label": "metadata",
          "value": "metadata",
          "schema": {
            "type": [
              "array",
              "boolean"
            ],
            "example": false
          }
        },
        {
          "label": "modified",
          "value": "modified",
          "schema": {
            "type": "string",
            "example": "2026-09-10T10:35:12+02:00"
          }
        },
        {
          "label": "page_template",
          "value": "page_template",
          "schema": {
            "type": "string",
            "example": ""
          }
        },
        {
          "label": "parent",
          "value": "parent",
          "schema": {
            "type": [
              "boolean",
              "object"
            ],
            "example": false
          }
        },
        {
          "label": "password",
          "value": "password",
          "schema": {
            "type": "string",
            "example": ""
          }
        },
        {
          "label": "post_thumbnail",
          "value": "post_thumbnail",
          "schema": {
            "type": [
              "object",
              "null"
            ],
            "example": {
              "ID": 1043,
              "URL": "https://acmeblog.files.wordpress.com/2026/09/cover.jpg",
              "guid": "https://acmeblog.files.wordpress.com/2026/09/cover.jpg",
              "mime_type": "image/jpeg",
              "width": 1200,
              "height": 630
            }
          }
        },
        {
          "label": "sharing_enabled",
          "value": "sharing_enabled",
          "schema": {
            "type": "boolean",
            "example": true
          }
        },
        {
          "label": "short_URL",
          "value": "short_URL",
          "schema": {
            "type": "string",
            "example": "https://wp.me/pNxYz-gO"
          }
        },
        {
          "label": "site_ID",
          "value": "site_ID",
          "schema": {
            "type": "integer",
            "example": 123456789
          }
        },
        {
          "label": "slug",
          "value": "slug",
          "schema": {
            "type": "string",
            "example": "hello-automation"
          }
        },
        {
          "label": "status",
          "value": "status",
          "schema": {
            "type": "string",
            "example": "publish"
          }
        },
        {
          "label": "sticky",
          "value": "sticky",
          "schema": {
            "type": "boolean",
            "example": false
          }
        },
        {
          "label": "title",
          "value": "title",
          "schema": {
            "type": "string",
            "example": "Hello automation"
          }
        },
        {
          "label": "type",
          "value": "type",
          "schema": {
            "type": "string",
            "example": "post"
          }
        }
      ]
    }
  ],
  "properties": {
    "schema": {
      "properties": {
        "siteId": {
          "type": "number"
        },
        "author": {
          "type": "number"
        }
      },
      "required": [
        "siteId"
      ]
    },
    "inspector": {
      "inputs": {
        "siteId": {
          "type": "text",
          "label": "Site",
          "index": 1,
          "source": {
            "url": "/component/appmixer/wordpress/posts/ListSites?outPort=sites",
            "data": {
              "transform": "./transformers#sitesToSelectArray"
            }
          },
          "tooltip": "Select site."
        },
        "author": {
          "type": "text",
          "label": "Author",
          "index": 2,
          "source": {
            "url": "/component/appmixer/wordpress/posts/ListUsers?outPort=users",
            "data": {
              "properties": {
                "siteId": "properties/siteId"
              },
              "transform": "./transformers#usersToSelectArray"
            }
          },
          "tooltip": "The username or ID for the user to assign the post to."
        }
      }
    }
  },
  "icon": "(data URI omitted)"
}
```
