OpenAI Post Generator
A powerful WordPress plugin that automatically generates and publishes articles using OpenAI's API.
by Ariful Islam · github.com/prodhan/openai-post-generator · website
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/prodhan/openai-post-generator/archive/refs/heads/main.zipOpenAI Post Generator WordPress Plugin
A powerful WordPress plugin that automatically generates and publishes articles using OpenAI's API.
Description
OpenAI Post Generator is a feature-rich WordPress plugin that leverages OpenAI's language models to automatically generate high-quality blog posts. With an intuitive interface and flexible scheduling options, you can automate your content creation process while maintaining control over the output.
Features
Core Features
- Configure OpenAI API settings (API key, model, token limits)
- Choose between GPT-3.5 Turbo and GPT-4 models
- Set maximum token limits for cost control
- Define custom prompts with dynamic placeholders
- Generate posts on demand or on schedule
- Detailed debug tools and logging
Post Generation
- Manual post generation with topic selection
- Preview generated content before publishing
- Choose post categories and status
- Fully automated scheduled post creation
Scheduling System
- Multiple scheduling frequencies:
- Every 5, 10, 30, or 60 minutes
- Hourly, twice daily, daily, or weekly
- Set specific times for standard schedules
- Configurable default post settings:
- Default author
- Default category
- Default post status (publish, draft, or pending)
Dynamic Content
- Use placeholders in both titles and prompts:
{date}: Current date and time{date_only}: Just the date{time_only}: Just the time{year},{month},{day}: Individual date components
- Create timely, contextual content automatically
Debugging & Maintenance
- Debug page for testing and diagnostics
- Manually trigger scheduled post generation
- View upcoming scheduled posts
- Comprehensive logging
Installation
- Download the plugin files and upload to
/wp-content/plugins/openai-post-generator/directory - Activate the plugin through the 'Plugins' menu in WordPress
- Go to 'Post Generator' in the admin menu
- Enter your OpenAI API key and configure your settings
- Start generating content!
Configuration
API Setup
- Obtain an API key from OpenAI's platform
- Enter your API key in the plugin settings
- Select your preferred model (GPT-3.5 Turbo or GPT-4)
- Set maximum tokens for generated content
- Define your default prompt template
Scheduling
- Choose your preferred schedule frequency
- Set the time for scheduled post generation (for standard schedules)
- Configure default category, author and post status for scheduled posts
- Create a custom title template with placeholders
- Save your settings
WordPress Cron
For scheduling to work properly:
- Ensure WordPress cron is functioning (or use a server cron job calling
wp-cron.php) - If using
DISABLE_WP_CRON, make sure to set up an alternative cron method
Usage
Manual Post Generation
- Go to the 'Generate Post' tab
- Enter your desired topic
- Select category and post status
- Click 'Generate Post'
- The generated post will be created according to your settings
Scheduled Posts
- Configure your scheduling preferences in settings
- The plugin will automatically generate posts at your specified intervals
- Posts will use your default settings for category, author, and status
- Use the Debug page to test your scheduled post setup
Using Placeholders
In both your default prompt and title templates, you can use these placeholders:
{date}- Full date and time (e.g., 2025-05-04 18:30){date_only}- Date only (e.g., 2025-05-04){time_only}- Time only (e.g., 18:30){year}- Current year (e.g., 2025){month}- Current month (e.g., 05){day}- Current day (e.g., 04)
Examples:
- Title:
Daily News Update: {date_only} - Prompt:
Write a comprehensive market analysis for {month}/{year} focusing on emerging trends.
Debugging
If you encounter issues:
- Go to 'Post Generator > Debug'
- Check the next scheduled run information
- Test by manually generating a scheduled post
- Review the debug logs at
wp-content/debug.log
Requirements
- WordPress 5.0 or higher
- PHP 7.4 or higher
- OpenAI API key
- WordPress cron enabled (or alternative cron setup)
WordPress.org Plugin Info
- Requires at least: 5.0
- Tested up to: 6.4
- Requires PHP: 7.4
- Stable tag: 1.0.0
- License: GPLv2 or later
- License URI: https://www.gnu.org/licenses/gpl-2.0.html
Author
- Ariful Islam
- Website: ariful.net
- GitHub: prodhan
License
This plugin is licensed under the GPL v2 or later.
See LICENSE for more information.
Support
For support, please open an issue on the GitHub repository.
Changelog
1.0.0
- Initial release
- OpenAI API integration
- Basic post generation
- Scheduling functionality
- Customizable settings
- Debug tools