Post Classifier AI is a professional-grade WordPress plugin that leverages the Google Gemini 2.5 Flash Lite API to automate post categorization. Built with a focus on clean architecture and performance, it removes the manual effort of tagging content while ensuring your site's taxonomy remains consistent.
- Automated Taxonomy: Analyzes post content on publish and suggests 3 highly relevant categories.
- Smart Cleanup: Automatically removes the default "Uncategorized" tag if AI categories are found.
- Optimized Performance: Trims content before API transmission to ensure fast execution and lower latency.
- Secure Configuration: Dedicated Settings UI for API Key management using the WordPress Settings API.
- Loop Protection: Implements native WordPress hooks safely to prevent recursive save issues.
This project was designed using Object-Oriented Programming (OOP) principles and follows WordPress Coding Standards:
- Service Layer: Uses
wp_remote_postfor secure communication with external APIs. - Taxonomy Logic: Uses
term_existsandwp_insert_termto dynamically manage categories without duplication. - Data Integrity: Implements rigorous sanitization and capability checks (
manage_options).
- Download or clone this repository into your
wp-content/plugins/directory. - Activate the plugin through the 'Plugins' menu in WordPress.
- Navigate to Settings > Post Classifier AI and enter your Google Gemini API Key.
- Publish a new post and watch the AI categorize your content in real-time.
Contributions are welcome! Please feel free to submit a Pull Request. This project follows the GPLv2 License.
Developed by Syed Muhammad Arieb - Engineering solutions at the intersection of AI and the Open Web.