The AutoBlogAgent is an automated blogging application designed to simplify the process of creating, managing, and publishing blog posts for the Asia Tech Academy. The application integrates with WordPress, Cloudflare AI, and SERP APIs to generate high-quality blog content, images, and meta descriptions, enhancing SEO and audience engagement.
- Automated Blog Post Generation: Uses LLM (e.g., Groq API) to create engaging blog posts based on the latest information gathered from the web.
- Dynamic Title and Content Creation: Generates titles and content tailored to specific queries and SEO requirements.
- Image Generation: Creates AI-generated images based on blog topics using Cloudflare AI.
- WordPress Integration: Automatically uploads blog posts and featured images to WordPress.
- SEO-Ready Posts: Ensures posts include titles, featured images, and categories for optimal SEO performance.
- Manual Meta Description Update: Meta descriptions are provided but require manual addition in WordPress due to API limitations.
- Python 3.8+
- A WordPress site with REST API enabled
- WordPress: Basic Authentication credentials
- Cloudflare AI: API token
- SERP API: API key
- Groq API: API key (for LLM integration)
Create a virtual environment and install the required dependencies:
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txtSet up the .env file in the project root with the following variables:
WP_APP_KEY=<WordPress Basic Auth Key>
WP_BASE_URL=<Your WordPress Base URL>
CLOUDFLARE_API_TOKEN=<Cloudflare API Token>
SERP_API_KEY=<SERP API Key>
GROQ_API_KEY=<Groq API Key>Activate your virtual environment and run the script:
python blog_poster.pyThe application follows these steps:
- Search for Latest Information: Uses SERP API to gather relevant data.
- Generate Content: Uses LLM to create a title and blog content.
- Generate Images: Creates AI-generated images for the blog post.
- Upload to WordPress: Publishes the post with the featured image.
- Manual Meta Description: Provides a meta description for manual addition in WordPress.
- Meta Description Automation: Due to Yoast SEO API limitations, meta descriptions must be added manually in WordPress.
- Yoast SEO Integration: Requires a custom PHP filter to fully utilize
_yoast_wpseo_metadesc.
ATAAutoBlogger/
├── blog_poster.py # Main application script
├── requirements.txt # Python dependencies
├── .env # Environment variables (not included in repo)
├── README.md # Documentation
└── utils/ # Utility functions and modules
- Enable full automation of Yoast SEO meta descriptions via direct database updates or alternative plugins.
- Add support for scheduled posts using cron jobs.
- Implement robust error handling and logging.
- Expand AI capabilities for multi-language support.
-
Image Upload Errors:
- Ensure the Cloudflare API token is valid.
- Check WordPress media upload permissions.
-
Meta Description Missing:
- Confirm the manual process for adding meta descriptions in WordPress.
- Verify the custom PHP filter is correctly implemented.
-
Authentication Errors:
- Double-check the
WP_APP_KEYin the.envfile. - Ensure WordPress REST API is enabled.
- Double-check the