A WordPress Gutenberg sidebar plugin that integrates with the OpenAI API to assist content creators directly inside the Block Editor.
| Feature | Description |
|---|---|
| 📝 Meta Description Generator | Generates SEO-optimized meta descriptions (150-160 chars) from post content |
| 🏷️ Tag Suggester | Analyzes content and suggests 5-8 relevant, searchable tags |
| 📄 Post Summarizer | Creates concise 2-3 sentence summaries, with one-click "Set as Excerpt" |
Coming soon
- OOP PHP architecture — Singleton main class, separated concerns (Settings, API Client, AJAX Handler)
- Security-first — Nonce verification, capability checks, input sanitization, output escaping
- Gutenberg native — Built with
@wordpress/plugins,@wordpress/components,@wordpress/data - Clean API abstraction — OpenAI client class with structured prompts and proper error handling via
WP_Error - WordPress Settings API — Full admin settings page with sanitization and whitelisted model selection
ai-content-toolkit/
├── ai-content-toolkit.php # Main plugin file (singleton bootstrap)
├── includes/
│ ├── class-settings.php # Admin settings page (API key, model, tokens)
│ ├── class-openai-client.php # OpenAI API wrapper (wp_remote_post)
│ └── class-ajax-handler.php # AJAX endpoints with security checks
├── src/
│ ├── index.js # Gutenberg sidebar (React components)
│ └── style.css # Sidebar styles
├── build/ # Compiled assets (@wordpress/scripts)
├── package.json
├── .gitignore
└── README.md
# Clone into your WordPress plugins directory
cd wp-content/plugins/
git clone https://github.com/sharanvijay/ai-content-toolkit.git
cd ai-content-toolkit
# Install dependencies and build
npm install
npm run build- Activate the plugin in Plugins → Installed Plugins
- Go to Settings → AI Content Toolkit
- Enter your OpenAI API key (Get one here)
- Select your preferred model and token limit
- Open any post in the Block Editor — click the AI Content Toolkit icon in the top-right toolbar
- Write your post content in the Block Editor
- Click the AI Content Toolkit sidebar icon (layered diamond icon)
- Use any of the three panels:
- Meta Description → Generate → Edit if needed → Copy
- Tag Suggestions → Suggest → Copy All
- Post Summary → Summarize → Set as Excerpt or Copy
- WordPress 6.0+
- PHP 7.4+
- OpenAI API key with available credits
- API key stored in
wp_options, never exposed to the frontend - All AJAX requests verified with
wp_verify_nonce() - User capability checked with
current_user_can( 'edit_posts' ) - All input sanitized with
sanitize_text_field()/sanitize_textarea_field() - Content trimmed to 1000 words to prevent excessive API usage
# Start development mode (auto-rebuild on file changes)
npm run start
# Production build
npm run buildR Saravanan
- LinkedIn: linkedin.com/in/sharanvijay
- Email: sharanvijay.r@gmail.com
GPL-2.0+ — See LICENSE