What this automation does
When you publish or update a WordPress post, this automation reads the full content, identifies the target keyword, and performs a comprehensive SEO audit. It generates an optimized meta title and description, suggests heading restructuring for better H2/H3 hierarchy, identifies internal linking opportunities from your existing content, and adds alt text to images.
This replaces the tedious post-publishing SEO checklist that most bloggers skip. Instead of manually running through Yoast or RankMath suggestions, the AI handles it automatically and makes the changes in your post.
Tools you need
- WordPress (self-hosted): Your blog — needs REST API access and a custom field plugin for SEO data
- OpenAI API (GPT-4): Analyzes content and generates SEO optimizations ($0.03-0.08 per post)
- n8n or Zapier: Triggers on new posts, orchestrates the AI analysis, writes changes back to WordPress
How to set it up
Step 1: Set up an n8n workflow triggered by WordPress post publication (use the WordPress webhook). Fetch the full post content including title, body HTML, existing meta description, and current internal links.
Step 2: Send the post content to OpenAI with a prompt that asks for: optimized meta title (under 60 characters), meta description (under 155 characters), suggested H2/H3 restructuring, 3-5 internal linking suggestions based on your sitemap, and image alt text suggestions.
Step 3: Use n8n's WordPress node to update the post with the AI suggestions. For meta fields, update via Yoast or RankMath's API. For internal links, inject them into the post body at relevant paragraphs.
Step 4: Set the automation to save changes as a draft revision rather than publishing directly. Review the first 10 posts manually, then gradually increase auto-publishing confidence as the prompt improves.
Cost breakdown
| Item | Cost | Notes |
|---|---|---|
| n8n (self-hosted) | $0 | Free and open-source, or $20/mo for cloud |
| OpenAI API | $5-$15/mo | ~$0.05 per post at 100-300 posts/mo |
| WordPress plugins | $0-$10/mo | Yoast free works; premium is optional |
| Setup time | 30-45 min | One-time configuration |
| Total monthly | $5-$25/mo | Saves 20 min per post — significant for content teams |
Frequently asked questions
Yes. Both Yoast and RankMath expose their meta fields via the WordPress REST API. The automation reads and writes to these fields directly. It works with either plugin — you just need to adjust which custom fields the workflow targets.
No. Google's guidelines focus on content quality, not whether a human or AI wrote the meta description. This automation optimizes existing human-written content — it does not generate the post itself. The SEO improvements (meta descriptions, heading structure, internal links) are exactly what a human SEO specialist would do.