> ## 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.

# Meta abilities: read and write post and user metadata

> Read, write, and bulk-update WordPress metadata for posts, terms, and users. Always pass plain values — WordPress handles serialization automatically.

Meta abilities let you get and set WordPress metadata for any object type — posts (and custom post types), taxonomy terms, and users. Permission checks are enforced per object, so the abilities respect the same access rules as native WordPress.

## All meta abilities

| Ability                 | Description                                                                                                                                                           | Capability                  | Plan    |
| ----------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------- | ------- |
| `maxi/get-meta`         | Get a single meta value, or all meta for an object.                                                                                                                   | `read` + object-level       | Lite    |
| `maxi/set-meta`         | Add or update a single meta value on an object.                                                                                                                       | `edit_posts` + object-level | Lite    |
| `maxi/delete-meta`      | Delete a meta key from an object.                                                                                                                                     | `edit_posts` + object-level | Lite    |
| `maxi/list-meta`        | List all meta keys and values for an object, with an optional filter to show or hide internal keys.                                                                   | `read` + object-level       | Lite    |
| `maxi/bulk-update-meta` | Set meta across up to 500 objects and 100 keys in a single call. Accepts a single object, an array of IDs, or a parent product ID that expands to all its variations. | `edit_posts` + object-level | **Pro** |

<Note>
  `maxi/bulk-update-meta` is a Pro plan ability. It is not available on the Lite plan.
</Note>

## Object types

All meta abilities accept an `object_type` parameter:

* `post` — applies to posts, pages, and any custom post type
* `term` — applies to taxonomy terms (categories, tags, and custom taxonomies)
* `user` — applies to WordPress users

## Key ability examples

### maxi/get-meta

Retrieve a single meta value by key, or retrieve all meta for an object by omitting `meta_key`.

<Tabs>
  <Tab title="Single key">
    ```json theme={null}
    {
      "object_type": "post",
      "object_id": 123,
      "meta_key": "_custom_field"
    }
    ```
  </Tab>

  <Tab title="All meta">
    ```json theme={null}
    {
      "object_type": "post",
      "object_id": 123
    }
    ```
  </Tab>
</Tabs>

### maxi/set-meta

Add a new meta value or update an existing one. If the key does not exist, WordPress creates it. If it already exists, WordPress updates it.

```json theme={null}
{
  "object_type": "post",
  "object_id": 123,
  "meta_key": "_custom_field",
  "meta_value": "some value"
}
```

### maxi/bulk-update-meta

**Pro only.** Set multiple meta keys across many objects at once. Pass an `object_ids` array and a `meta` object with all the keys and values to apply.

```json theme={null}
{
  "object_ids": [100, 101, 102],
  "object_type": "post",
  "meta": {
    "_custom_field": "value",
    "_another_field": "other"
  }
}
```

<Info>
  `maxi/bulk-update-meta` also accepts a `parent_id` input shape for WooCommerce variable products. When you pass `parent_id`, the ability expands the operation to all variations of that product automatically.
</Info>

## Passing meta values

<Warning>
  Always pass **plain, unserialized values** to meta abilities. WordPress handles serialization automatically when it stores the value.

  **Correct:**

  ```json theme={null}
  { "meta_value": "test-class" }
  ```

  **Incorrect — do not pre-serialize:**

  ```json theme={null}
  { "meta_value": "a:1:{i:0;s:10:\"test-class\";}" }
  ```

  Pre-serializing values causes double serialization, which corrupts the stored data and produces broken reads.
</Warning>

## Permission model

Meta abilities enforce **object-level permission checks** in addition to the capability listed in the table above:

* **Post reads** require the `read_post` capability for that specific post.
* **Post writes** require the `edit_post` capability for that specific post.
* **User meta reads** require `list_users`. User meta writes require `edit_user`.
* **Term meta writes** require the `manage_terms` capability for that taxonomy.
* **Term meta reads** are open — terms are public taxonomy objects and do not require additional capability.

If the connected WordPress user does not have the required capability for a specific object, the ability returns an error for that object rather than silently skipping it.
