> For the complete documentation index, see [llms.txt](https://githubichsan.gitbook.io/journal/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://githubichsan.gitbook.io/journal/wordpress-development/rest-api/posts.md).

# /posts

Query this endpoint to retrieve a collection of posts. The response you receive can be controlled and filtered using the URL query parameters below.

`GET /wp/v2/posts`

| `context`            | <p>Scope under which the request is made; determines fields present in response.</p><p>Default: <code>view</code></p><p>One of: <code>view</code>, <code>embed</code>, <code>edit</code></p>                                                                                                                   |
| -------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `page`               | <p>Current page of the collection.</p><p>Default: <code>1</code></p>                                                                                                                                                                                                                                           |
| `per_page`           | <p>Maximum number of items to be returned in result set.</p><p>Default: <code>10</code></p>                                                                                                                                                                                                                    |
| `search`             | Limit results to those matching a string.                                                                                                                                                                                                                                                                      |
| `after`              | Limit response to posts published after a given ISO8601 compliant date.                                                                                                                                                                                                                                        |
| `modified_after`     | Limit response to posts modified after a given ISO8601 compliant date.                                                                                                                                                                                                                                         |
| `author`             | Limit result set to posts assigned to specific authors.                                                                                                                                                                                                                                                        |
| `author_exclude`     | Ensure result set excludes posts assigned to specific authors.                                                                                                                                                                                                                                                 |
| `before`             | Limit response to posts published before a given ISO8601 compliant date.                                                                                                                                                                                                                                       |
| `modified_before`    | Limit response to posts modified before a given ISO8601 compliant date.                                                                                                                                                                                                                                        |
| `exclude`            | Ensure result set excludes specific IDs.                                                                                                                                                                                                                                                                       |
| `include`            | Limit result set to specific IDs.                                                                                                                                                                                                                                                                              |
| `offset`             | Offset the result set by a specific number of items.                                                                                                                                                                                                                                                           |
| `order`              | <p>Order sort attribute ascending or descending.</p><p>Default: <code>desc</code></p><p>One of: <code>asc</code>, <code>desc</code></p>                                                                                                                                                                        |
| `orderby`            | <p>Sort collection by post attribute.</p><p>Default: <code>date</code></p><p>One of: <code>author</code>, <code>date</code>, <code>id</code>, <code>include</code>, <code>modified</code>, <code>parent</code>, <code>relevance</code>, <code>slug</code>, <code>include\_slugs</code>, <code>title</code></p> |
| `search_columns`     | Array of column names to be searched.                                                                                                                                                                                                                                                                          |
| `slug`               | Limit result set to posts with one or more specific slugs.                                                                                                                                                                                                                                                     |
| `status`             | <p>Limit result set to posts assigned one or more statuses.</p><p>Default: <code>publish</code></p>                                                                                                                                                                                                            |
| `tax_relation`       | <p>Limit result set based on relationship between multiple taxonomies.<br>One of: <code>AND</code>, <code>OR</code></p>                                                                                                                                                                                        |
| `categories`         | Limit result set to items with specific terms assigned in the categories taxonomy.                                                                                                                                                                                                                             |
| `categories_exclude` | Limit result set to items except those with specific terms assigned in the categories taxonomy.                                                                                                                                                                                                                |
| `tags`               | Limit result set to items with specific terms assigned in the tags taxonomy.                                                                                                                                                                                                                                   |
| `tags_exclude`       | Limit result set to items except those with specific terms assigned in the tags taxonomy.                                                                                                                                                                                                                      |
| `sticky`             | Limit result set to items that are sticky.                                                                                                                                                                                                                                                                     |

`POST /wp/v2/posts`

| [`date`](https://developer.wordpress.org/rest-api/reference/posts/#schema-date)                     | The date the post was published, in the site's timezone.                                                                                                                                                                                              |
| --------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [`date_gmt`](https://developer.wordpress.org/rest-api/reference/posts/#schema-date_gmt)             | The date the post was published, as GMT.                                                                                                                                                                                                              |
| [`slug`](https://developer.wordpress.org/rest-api/reference/posts/#schema-slug)                     | An alphanumeric identifier for the post unique to its type.                                                                                                                                                                                           |
| [`status`](https://developer.wordpress.org/rest-api/reference/posts/#schema-status)                 | <p>A named status for the post.<br>One of: <code>publish</code>, <code>future</code>, <code>draft</code>, <code>pending</code>, <code>private</code></p>                                                                                              |
| [`password`](https://developer.wordpress.org/rest-api/reference/posts/#schema-password)             | A password to protect access to the content and excerpt.                                                                                                                                                                                              |
| [`title`](https://developer.wordpress.org/rest-api/reference/posts/#schema-title)                   | The title for the post.                                                                                                                                                                                                                               |
| [`content`](https://developer.wordpress.org/rest-api/reference/posts/#schema-content)               | The content for the post.                                                                                                                                                                                                                             |
| [`author`](https://developer.wordpress.org/rest-api/reference/posts/#schema-author)                 | The ID for the author of the post.                                                                                                                                                                                                                    |
| [`excerpt`](https://developer.wordpress.org/rest-api/reference/posts/#schema-excerpt)               | The excerpt for the post.                                                                                                                                                                                                                             |
| [`featured_media`](https://developer.wordpress.org/rest-api/reference/posts/#schema-featured_media) | The ID of the featured media for the post.                                                                                                                                                                                                            |
| [`comment_status`](https://developer.wordpress.org/rest-api/reference/posts/#schema-comment_status) | <p>Whether or not comments are open on the post.<br>One of: <code>open</code>, <code>closed</code></p>                                                                                                                                                |
| [`ping_status`](https://developer.wordpress.org/rest-api/reference/posts/#schema-ping_status)       | <p>Whether or not the post can be pinged.<br>One of: <code>open</code>, <code>closed</code></p>                                                                                                                                                       |
| [`format`](https://developer.wordpress.org/rest-api/reference/posts/#schema-format)                 | <p>The format for the post.<br>One of: <code>standard</code>, <code>aside</code>, <code>chat</code>, <code>gallery</code>, <code>link</code>, <code>image</code>, <code>quote</code>, <code>status</code>, <code>video</code>, <code>audio</code></p> |
| [`meta`](https://developer.wordpress.org/rest-api/reference/posts/#schema-meta)                     | Meta fields.                                                                                                                                                                                                                                          |
| [`sticky`](https://developer.wordpress.org/rest-api/reference/posts/#schema-sticky)                 | Whether or not the post should be treated as sticky.                                                                                                                                                                                                  |
| [`template`](https://developer.wordpress.org/rest-api/reference/posts/#schema-template)             | The theme file to use to display the post.                                                                                                                                                                                                            |
| [`categories`](https://developer.wordpress.org/rest-api/reference/posts/#schema-categories)         | The terms assigned to the post in the category taxonomy.                                                                                                                                                                                              |
| [`tags`](https://developer.wordpress.org/rest-api/reference/posts/#schema-tags)                     | The terms assigned to the post in the post\_tag taxonomy.                                                                                                                                                                                             |

`GET /wp/v2/posts/<id>`

`POST /wp/v2/posts/<id>`Update a post

`DELETE /wp/v2/posts/<id>`

<br>

\ <br>
