/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

Scope under which the request is made; determines fields present in response.

Default: view

One of: view, embed, edit

page

Current page of the collection.

Default: 1

per_page

Maximum number of items to be returned in result set.

Default: 10

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

Order sort attribute ascending or descending.

Default: desc

One of: asc, desc

orderby

Sort collection by post attribute.

Default: date

One of: author, date, id, include, modified, parent, relevance, slug, include_slugs, title

search_columns

Array of column names to be searched.

slug

Limit result set to posts with one or more specific slugs.

status

Limit result set to posts assigned one or more statuses.

Default: publish

tax_relation

Limit result set based on relationship between multiple taxonomies. One of: AND, OR

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

The date the post was published, in the site's timezone.

The date the post was published, as GMT.

An alphanumeric identifier for the post unique to its type.

A named status for the post. One of: publish, future, draft, pending, private

A password to protect access to the content and excerpt.

The title for the post.

The content for the post.

The ID for the author of the post.

The excerpt for the post.

The ID of the featured media for the post.

Whether or not comments are open on the post. One of: open, closed

Whether or not the post can be pinged. One of: open, closed

The format for the post. One of: standard, aside, chat, gallery, link, image, quote, status, video, audio

Meta fields.

Whether or not the post should be treated as sticky.

The theme file to use to display the post.

The terms assigned to the post in the category taxonomy.

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>

Last updated