
Everything you need to know about using the WordPress REST API to create, schedule, and manage blog posts programmatically — including authentication, endpoints, and error handling.
The WordPress REST API is the backbone of any serious content automation system. It allows external applications to create, read, update, and delete WordPress content without touching wp-admin. If you're building or evaluating an automated publishing workflow, understanding this API is essential.
Introduced in WordPress 4.7 (2016) and significantly expanded through WordPress 5.x, the REST API provides a standardized HTTP interface to WordPress data. Every post, page, category, tag, user, and media file has a corresponding API endpoint.
The base URL for all REST API requests is:
https://yoursite.com/wp-json/wp/v2/
For automated publishing, the recommended authentication method is WordPress Application Passwords — a native feature available since WordPress 5.6 (no plugins required).
Your authentication header uses HTTP Basic Auth with your WordPress username and the Application Password (not your regular login password):
Authorization: Basic base64(username:application_password)
To create a new WordPress post, send a POST request to /wp-json/wp/v2/posts:
POST https://yoursite.com/wp-json/wp/v2/posts
Content-Type: application/json
Authorization: Basic [encoded credentials]
{
"title": "Your Article Title",
"content": "<p>Article content in HTML...</p>",
"status": "publish",
"excerpt": "A brief summary of the article",
"categories": [5],
"tags": [12, 18],
"featured_media": 847,
"meta": {
"_yoast_wpseo_metadesc": "SEO meta description here",
"_yoast_wpseo_focuskw": "target keyword"
}
}
Featured images must be uploaded separately before creating the post. Use the media endpoint:
POST https://yoursite.com/wp-json/wp/v2/media
Content-Type: image/jpeg
Content-Disposition: attachment; filename="featured-image.jpg"
Authorization: Basic [encoded credentials]
[binary image data]
The response returns the media object including its id, which you then pass as featured_media when creating the post.
To schedule a post for future publication, set status to "future" and include a date in ISO 8601 format:
{
"status": "future",
"date": "2025-04-01T09:00:00",
...
}
Skip the API work: AutoPublish handles all WordPress REST API authentication, image uploads, scheduling, and error handling automatically. Connect your site in under 2 minutes and start publishing. Try it free →
Join 140+ agencies publishing SEO content automatically. Set up in 5 minutes — 7-day free trial, no credit card.
The AutoPublish team builds WordPress content automation for marketing agencies. We write about SEO, AI content strategy, and scaling content operations — and we use AutoPublish to publish this very blog automatically.



SEO guides, agency tips, and automation strategies. No spam — unsubscribe any time.
Sign up free — get first article published today