Automate WordPress Blog Post Generation with AI, Smart Categories & Media Uploads
detail.loadingPreview
Effortlessly scale your content strategy by automatically generating and publishing unique WordPress blog posts. This workflow leverages AI (GPT) to craft engaging articles, intelligently picks categories, and handles media uploads, all on a set schedule.
About This Workflow
Supercharge your content pipeline with this powerful n8n workflow designed to automate your WordPress blogging. It intelligently selects the least-used category from your PostgreSQL database to ensure diverse content, then uses a sophisticated AI model (GPT-4.1) to generate high-quality, structured blog posts, complete with a table of contents and calls to action. The workflow also automates the generation and upload of a relevant cover image to your WordPress media library before publishing the complete article, freeing up valuable time for your marketing team.
Key Features
- Scheduled Content Generation: Automatically creates and publishes new blog posts at predefined intervals (e.g., every few hours).
- AI-Powered Article Creation: Utilizes OpenAI's GPT models to generate unique, well-structured articles with professional formatting.
- Smart Category Management: Integrates with PostgreSQL to track and prioritize the least-used WordPress categories for balanced content distribution.
- Automated Media Uploads: Generates and uploads relevant featured images directly to your WordPress media library, linking them to the post.
- Full WordPress Integration: Publishes posts directly to your WordPress site with a 'publish' status, ready for readers.
How To Use
To get this workflow up and running, follow these steps:
- Set DOMAIN Variable: Define your WordPress site URL (e.g.,
DOMAIN=https://your-wordpress-site.com) as an environment variable or in a 'Set' node anywhere before the workflow starts. This is used for all WordPress REST API calls. - Create n8n Credentials: Set up the following credentials in n8n (use the exact names specified in the workflow's sticky note):
YOUR_WORDPRESS_CREDENTIAL(WordPress API withPOST /media,POST /postsscope)YOUR_POSTGRES_CREDENTIAL(PostgreSQL access)YOUR_OPENAI_CREDENTIAL(OpenAI key for GPT-4 mini or better)
- Configure PostgreSQL Database:
- Connect to your PostgreSQL server (e.g.,
sudo -u postgres psqlin terminal). - Execute the SQL commands provided in the workflow's sticky note to create the
n8n_blogdatabase,n8n_writeruser, and theused_categoriestracking table. Grant necessary privileges. - Configure your
YOUR_POSTGRES_CREDENTIALin n8n with these database details.
- Connect to your PostgreSQL server (e.g.,
- Initial Test: Manually run the first 3–5 nodes of the workflow to verify WordPress authentication, database connection, and GPT responses.
- Enable Schedule Trigger: Once initial tests are successful, activate the 'Schedule Trigger' node to begin automated blog post publishing.
Apps Used
Workflow JSON
{
"id": "f3919413-39dc-4e9f-b8a7-5ccaafb3ca25",
"name": "Automate WordPress Blog Post Generation with AI, Smart Categories & Media Uploads",
"nodes": 23,
"category": "Marketing",
"status": "active",
"version": "1.0.0"
}Note: This is a sample preview. The full workflow JSON contains node configurations, credentials placeholders, and execution logic.
Get This Workflow
ID: f3919413-39dc...
About the Author
Free n8n Workflows Official
System Admin
The official repository for verified enterprise-grade workflows.
Statistics
Related Workflows
Discover more workflows you might like
AI-Powered On-Page SEO Audit & Report Automation
Instantly generate comprehensive on-page SEO technical and content audits for any website URL. This AI-powered workflow automates the entire process, from scraping the page to delivering a detailed report directly to your inbox, empowering you to optimize for better search rankings and user engagement.
Automate LinkedIn Content Promotion for Your Ghost Blog with AI
Effortlessly promote your latest Ghost blog posts on LinkedIn. This workflow leverages AI to generate engaging, professional LinkedIn messages based on your article content and saves them, along with article metadata, directly to a Google Sheet.
AI-Powered Instagram Comment Automation
This n8n workflow intelligently automates responses to Instagram comments, leveraging advanced AI to engage with your audience. It filters out irrelevant content and personalizes replies, saving you time while boosting your social media presence.