Auto WordPress Blog Generator (GPT + Postgres + WP Media)
This workflow combines the OpenAI GPT model with a PostgreSQL database to achieve the automatic generation and publishing of WordPress blog posts. It can generate original and structured article content, automatically selecting the least frequently used categories to avoid duplication, while also generating and uploading cover images to ensure visual appeal. The entire process is highly automated, allowing for scheduled updates without user intervention, significantly enhancing the efficiency and diversity of blog content production, making it suitable for bloggers and content creators.

Workflow Name
Auto WordPress Blog Generator (GPT + Postgres + WP Media)
Key Features and Highlights
This workflow leverages the OpenAI GPT model to automatically generate high-quality blog posts formatted for WordPress. It integrates with a PostgreSQL database to track category usage frequency and automatically selects the least-used categories for publishing new articles. Additionally, it generates and uploads cover images to the WordPress media library, enabling fully automated end-to-end blog content publishing.
Core Problems Addressed
- Automatically generates original, well-structured WordPress blog posts, saving time and reducing manual content creation costs.
- Records category usage in a database to avoid content repetition, enhancing content diversity and SEO performance.
- Automatically creates and uploads cover images to improve the visual appeal of posts.
- Enables scheduled blog publishing without manual intervention, ensuring continuous content updates.
Use Cases
- Automated content management for WordPress websites.
- Enhancing blog output efficiency for content marketing teams.
- SEO optimization by maintaining website activity and content variety.
- Automated generation of themed content for blogs and media platforms.
Main Workflow Steps
- Scheduled Trigger: The workflow runs automatically every few hours.
- Configuration Loading: Set the WordPress site domain.
- Load and Filter Categories: Retrieve all categories via the WordPress REST API and filter out excluded categories (e.g., comment-related).
- Query Database: Read the latest usage timestamps for each category from the PostgreSQL database.
- Select Category: Choose the category that has been unused the longest or has the lowest usage frequency.
- Retrieve Historical Article Titles: Fetch the last 10 article titles under the selected category to avoid topic duplication.
- Generate New Article Title: Use the OpenAI GPT model to create a unique, high-click-rate article title based on category info and historical titles.
- Generate Full Article Content: Use GPT to produce the article body formatted in WordPress HTML block structure, including table of contents, paragraphs, lists, etc.
- Generate Cover Image Placeholder URL: Create a placeholder URL for the article’s cover image.
- Download Cover Image: Perform an HTTP request to download the cover image file.
- Upload Cover Image to WordPress Media Library: Upload the image via the WordPress API.
- Assemble Article Content and Cover Info: Construct the complete JSON payload required for publishing.
- Publish Article to WordPress: Post the article using the WordPress REST API.
- Update Database Records: Log the used category and article title in the PostgreSQL database to track usage.
Involved Systems and Services
- WordPress: Manages categories, media, and post publishing via REST API.
- OpenAI GPT-4.1 Model: Generates article titles and content.
- PostgreSQL Database: Stores and manages category usage records to ensure content diversity.
- HTTP Request Node: Downloads cover images.
- n8n Automation Platform: Orchestrates and connects all system nodes to execute the workflow.
Target Users and Value
- Bloggers and content creators seeking to reduce content creation workload through automation.
- Digital marketers requiring continuous blog updates to improve SEO rankings.
- WordPress site administrators aiming for stable and efficient content maintenance.
- Content teams looking to leverage AI for generating professional, structured articles that enhance quality and user experience.
- Technical teams aiming to build a fully automated content production pipeline to optimize operational efficiency.
This workflow combines intelligent topic selection and content generation with automated WordPress publishing and cover image management, enabling users to effortlessly achieve efficient, continuous, and diverse blog operations.