An automated content creation system that generates SEO-optimized, casual-friendly articles and publishes them directly to WordPress. The system uses CrewAI to orchestrate multiple AI agents that handle different aspects of the content creation pipeline.

- Trend analysis and research
- SEO-optimized content creation
- Casual and friendly writing style
- Multi-language support with cultural adaptation
- Automated WordPress publishing
- Modular agent-based architecture
- Python 3.8+
- OpenAI API key for LLM activation
- SerperDev API key for research
- WordPress REST API credentials which can be generated from an Edit User page (wp-admin -> Users -> Edit User)
- Clone the repository:
git clone https://github.com/harrylicious/ai-wordpress-agent
cd ai-wordpress-agent- Install required packages:
pip install crewai crewai-tools python-dotenv requests fastapi uvicorn- Set up your environment variables in a
.envfile:
OPENAI_API_KEY=your_openai_api
SERPER_API_KEY=your_serper_api_key
WORDPRESS_URL=your_wordpress_site_url
WORDPRESS_USERNAME=your_admin_username
WORDPRESS_PASSWORD=your_admin_password- Start server uvicorn main:app --host 0.0.0.0 --port 8000
- Access server http://0.0.0.0:8000/docs
- Try out!
- Trend Analyst
- Researches current trends
- Identifies viral content opportunities
- Analyzes audience interests
- Content Creator
- Writes engaging, casual content
- Uses conversational tone
- Incorporates storytelling elements
- SEO Specialist
- Optimizes content for search engines
- Maintains readability
- Implements keyword strategy
- Language Adapter
- Translates content
- Adapts cultural references
- Maintains tone across languages
- Content Publisher
- Formats content for WordPress
- Handles meta information
- Manages publication process
- Trend Analysis
- Research current trends
- Identify viral angles
- Gather key insights
- Content Creation
- Write engaging content
- Maintain casual tone
- Include relatable examples
- SEO Optimization
- Integrate keywords
- Structure content
- Add meta information
- Translation
- Translate content
- Adapt cultural elements
- Preserve SEO value
- Publishing
- Format content
- Set up meta data
- Publish to WordPress
WordPressUploadTool: Handles WordPress REST API interactionsSerperDevTool: Provides search and research capabilities
ai-wordpress-agent/
├── crew_logic.py # Main crew and agent definitions
├── main.py # Main file
├── tools/
│ └── wordpress_upload_tool.py # WordPress interaction tool
│ └── __init__.py
├── .env # Environment variables
└── README.md # This file
The system can be configured through environment variables:
WORDPRESS_URL: Your WordPress site URLWORDPRESS_USERNAME: WordPress admin usernameWORDPRESS_PASSWORD: WordPress admin passwordSERPER_API_KEY: SerperDev API key for research
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Ensure your WordPress REST API is properly configured
- Keep your API keys and credentials secure
- Monitor your API usage to stay within limits
- Test translations before production use
Common issues and solutions:
- WordPress API Connection:
- Verify WordPress REST API is enabled
- Check credentials in .env file
- Ensure proper permissions are set
- Content Generation:
- Monitor agent outputs for errors
- Verify API keys are valid
- Check language code format
- Publishing Issues:
- Verify WordPress user permissions
- Check post status settings
- Monitor WordPress error logs
- Regularly update dependencies
- Monitor CrewAI version changes
- Keep API keys current
- Review WordPress compatibility For additional support or questions, please open an issue in the repository.
