Create a post or page
wp_create_postCreate a post, page or entry of a custom post type with title, content, status, excerpt, terms and custom fields; each call creates a new entry, so a repeated call makes a second one. Saved as a draft unless status says otherwise; publish, private and future need the right to publish, and a published entry shows on the site at once where its post type is publicly viewable. WordPress refuses an entry with empty title, content and excerpt for types that support all three, such as posts (empty_content). Returns {created: true, post} with the new entry's summary (the fields of wp_list_posts). Needs the right to create entries of the type. Existing entries are changed with wp_update_post, files are added with wp_upload_media. Page-builder data in "meta" (keys such as panels_data or dslc_code) takes the unfiltered_html capability, which on a multisite network only a super admin has; the keys are those of the core's list (filter ab_mcp_builder_markup_meta_keys) and of Pro's own (filter ab_mcp_pro_markup_meta_keys), and without the capability the call is refused before anything is written. Forwarded by AlphaBridge Connect to the one site this connection reaches.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| date | No | Publish date. Site time as "Y-m-d H:i:s" (or "Y-m-d H:i", "Y-m-d"), or RFC 3339 with an offset, the form of the dates this plugin returns, e.g. "2026-10-02T09:00:00+02:00". Times that do not exist in the site's timezone (clocks skip them) are refused, as is a time where the clocks go back that WordPress would read as the other of the two. | |
| meta | No | Key/value custom fields to set. Keys are stored as sanitize_key() writes them (lower case; letters, digits, _ and -). Keys starting with "_", protected or credential-like keys and keys the account may not edit are skipped without an error. Page-builder data (keys such as panels_data, dslc_code or pagelayer-data; filter ab_mcp_builder_markup_meta_keys) takes the unfiltered_html capability, which on a multisite network only a super admin has; without it the call is refused before anything is written. | |
| slug | No | URL slug. Default: WordPress derives it from the title, except for drafts and pending entries, which keep none until a save with another status (publish, private or future). Once the entry is no longer a draft or pending, WordPress adds a numeric suffix to a slug already in use. | |
| type | No | Post type, as wp_get_post_types lists it. Default "post". | post |
| terms | No | Taxonomy => array of term ids or names, e.g. {"category":["News"]}. A name that does not exist yet is created where the account may manage the taxonomy's terms, else left out; unknown taxonomies and taxonomies the account may not assign are skipped without an error. | |
| title | No | Title. Default empty. | |
| author | No | Author user id. Applied only for an account that may edit others' entries of this type; otherwise, and by default, the connected user is the author. | |
| parent | No | Parent post id, for hierarchical types such as pages. Default 0: none. | |
| status | No | draft, publish, pending, private, future. Default "draft". "future" needs a date at least five minutes ahead; "publish" with such a date schedules the post, as in WordPress. | |
| content | No | Content (HTML or block markup). | |
| excerpt | No | Excerpt. Default empty. |