> ## Documentation Index
> Fetch the complete documentation index at: https://docs.maxicore.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Content abilities: posts, pages, and custom post types

> Create, read, update, delete, and schedule WordPress posts, pages, and custom post types using Gutenberg block HTML via Maxi AI Core abilities.

Content abilities let you manage any registered post type on your WordPress site — posts, pages, WooCommerce products, or any custom type your theme or plugins register. Every write operation is permission-gated and recorded in the audit log, so you always have a clear trail of what changed.

## All content abilities

| Ability                    | Description                                                                     | Capability          | Plan |
| -------------------------- | ------------------------------------------------------------------------------- | ------------------- | ---- |
| `maxi/create-content`      | Create a new post, page, or custom post type entry.                             | `edit_posts`        | Lite |
| `maxi/get-content`         | Get a single post or page by ID.                                                | `read`              | Lite |
| `maxi/get-content-by-slug` | Get a post or page by its URL slug.                                             | `read`              | Lite |
| `maxi/update-content`      | Update any post or page fields. Send only the fields you want to change.        | `edit_posts`        | Lite |
| `maxi/delete-content`      | Delete or trash a post or page.                                                 | `delete_posts`      | Lite |
| `maxi/list-content`        | List posts or pages with filters for type, status, author, and parent.          | `read`              | Lite |
| `maxi/search-content`      | Search by keyword, taxonomy, meta, author, or date range across all post types. | `read`              | Lite |
| `maxi/duplicate-content`   | Duplicate a post along with all its meta and taxonomy terms.                    | `edit_posts`        | Lite |
| `maxi/change-status`       | Change a post's status to publish, draft, pending, private, or trash.           | `edit_posts`        | Lite |
| `maxi/schedule-content`    | Schedule a post for future publication at a specific date and time.             | `publish_posts`     | Lite |
| `maxi/set-author`          | Change the author of a post.                                                    | `edit_others_posts` | Lite |
| `maxi/set-parent`          | Set or remove the parent of a hierarchical post type (pages, etc.).             | `edit_pages`        | Lite |

<Note>
  All content abilities accept a `post_type` parameter. Pass any registered post type: `post`, `page`, `product`, or any custom type on your site. Abilities that don't receive `post_type` default to searching across all registered types.
</Note>

## Write gate

Write abilities — any ability that creates, updates, or deletes content — require the WordPress user connected to your AI client to have the **administrator** role (`manage_options`). This check is enforced in PHP server-side and cannot be bypassed. Read abilities (`get-content`, `list-content`, `search-content`) work for any authenticated user.

## Key ability examples

### maxi/create-content

Create a new post or page. Pass the content as valid Gutenberg block HTML (see [Content format](#content-format) below).

```json theme={null}
{
  "post_type": "post",
  "title": "My New Article",
  "content": "<!-- wp:paragraph --><p>Content here.</p><!-- /wp:paragraph -->",
  "status": "draft"
}
```

### maxi/get-content

Retrieve a single post by its numeric ID.

```json theme={null}
{ "id": 123 }
```

### maxi/list-content

List posts with filters. All `list-*` abilities accept `orderby`, `order`, `per_page`, and `page`.

```json theme={null}
{
  "post_type": "post",
  "status": "publish",
  "per_page": 10,
  "page": 1,
  "orderby": "date",
  "order": "DESC"
}
```

### maxi/update-content

Update specific fields on an existing post. Send only the fields you want to change — you do not need to repeat unchanged fields.

```json theme={null}
{
  "id": 123,
  "title": "Updated Title"
}
```

<Warning>
  **Read before writing content.** If you need to update the `content` field, you must first call `maxi/get-content` or `maxi/get-content-by-slug` for that post in the same session. This prevents you from overwriting content you haven't read. Skipping the read step causes the update to be rejected.
</Warning>

### maxi/search-content

Search by keyword, taxonomy, meta values, author, or a date range.

```json theme={null}
{
  "search": "wordpress plugin",
  "post_type": "post",
  "status": "publish"
}
```

### maxi/schedule-content

Schedule an existing draft for publication at a future date and time. Use MySQL datetime format (`YYYY-MM-DD HH:MM:SS`).

```json theme={null}
{
  "id": 123,
  "date": "2025-12-01 09:00:00"
}
```

## Content format

For new content, use **Gutenberg block HTML**. Plain HTML, shortcodes, and classic-editor content are also accepted — WordPress core's block parser handles all of these. Only an empty or whitespace-only string is rejected.

<Tabs>
  <Tab title="Paragraph">
    ```html theme={null}
    <!-- wp:paragraph -->
    <p>Your paragraph text goes here.</p>
    <!-- /wp:paragraph -->
    ```
  </Tab>

  <Tab title="Heading">
    ```html theme={null}
    <!-- wp:heading -->
    <h2>Section Title</h2>
    <!-- /wp:heading -->

    <!-- wp:heading {"level":3} -->
    <h3>Sub-heading</h3>
    <!-- /wp:heading -->

    <!-- wp:heading {"anchor":"my-id"} -->
    <h2 class="wp-block-heading" id="my-id">Anchored Heading</h2>
    <!-- /wp:heading -->
    ```
  </Tab>

  <Tab title="List">
    ```html theme={null}
    <!-- wp:list -->
    <ul>
    <li>Item one</li>
    <li>Item two</li>
    </ul>
    <!-- /wp:list -->
    ```
  </Tab>

  <Tab title="Code">
    ```html theme={null}
    <!-- wp:code -->
    <pre class="wp-block-code"><code>your code here</code></pre>
    <!-- /wp:code -->
    ```
  </Tab>

  <Tab title="Table">
    ```html theme={null}
    <!-- wp:table -->
    <figure class="wp-block-table"><table><thead><tr><th>Col</th></tr></thead><tbody><tr><td>Val</td></tr></tbody></table></figure>
    <!-- /wp:table -->
    ```
  </Tab>
</Tabs>

<Tip>
  You can combine multiple blocks in a single `content` value by concatenating them. Each block must have its own opening and closing comment delimiters.
</Tip>

## Audit log

Every content mutation is recorded in the audit log under the `content` category. Events include `content_created`, `content_updated`, `content_deleted`, `content_duplicated`, `status_changed`, `content_scheduled`, `author_changed`, and `parent_changed`. Query them with `maxi/get-audit-events` using `{ "category": "content" }`.
