A simple but powerful WordPress plugin that provides a REST API endpoint to create Gutenberg posts from AI-generated (or any) Markdown content.
This plugin is the perfect bridge between modern content workflows and WordPress, ensuring programmatically created posts are perfectly compatible with the Gutenberg block editor.
- Markdown to Gutenberg: Converts standard Markdown into a clean Gutenberg block structure.
- Custom REST API Endpoint: Provides a dedicated, easy-to-use API endpoint for content creation.
- AI-Ready: Designed specifically for content generated by AI models like Gemini, GPT, etc.
- Developer-Friendly: Secure and easy to integrate into any application or workflow.
- Lightweight: No bloat, just one core function done well.
Manually copying and pasting AI-generated content into WordPress is slow and error-prone. This plugin automates the process, allowing you to:
- Automate Content Pipelines: Directly publish from your scripts or applications.
- Ensure Compatibility: Avoids HTML formatting issues by using WordPress's native block conversion functions.
- Integrate with Headless Setups: Use WordPress as a backend and feed it content from anywhere.
-
Download
Parsedown.php: This plugin requires theParsedown.phplibrary.- Go to parsedown.org.
- Click the "Download" button to get the single
Parsedown.phpfile.
-
Add
Parsedown.phpto the Plugin:- Place the downloaded
Parsedown.phpfile into the root of this plugin's directory (/wp-content/plugins/ai-post-creator/).
- Place the downloaded
-
Install the Plugin:
- Upload the entire
ai-post-creatorfolder to the/wp-content/plugins/directory on your WordPress site. - Activate the "AI Post Creator" plugin through the 'Plugins' menu in WordPress.
- Upload the entire
To create a post, send a POST request to the following REST API endpoint. You must be authenticated with the WordPress REST API (e.g., using Application Passwords) and have the publish_posts capability.
Endpoint URL:
https://your-domain.com/wp-json/ai-creator/v1/create-post
Request Body (JSON):
{
"title": "Your Awesome AI-Generated Post Title",
"markdown_content": "## A Heading\n\nThis is a paragraph with **bold** text and a [link](https://wordpress.org).\n\n- List item 1\n- List item 2",
"status": "publish"
}title(string, required): The title of the post.markdown_content(string, required): The full Markdown content for the post body.status(string, optional): The post status. Can bepublish,draft, orpending. Defaults todraft.
Success Response (201 Created):
{
"success": true,
"post_id": 123,
"post_url": "https://your-domain.com/your-awesome-post-title/",
"message": "Post created successfully."
}This plugin is licensed under the GPLv2 or later.