Quick overview
This workflow checks recently published WordPress posts for missing or overlong SEO titles and meta descriptions, drafts fixes with Google Gemini, requests approval in Slack before updating WordPress via the REST API, logs outcomes in an n8n Data Table, and posts a weekly report verifying changes on the live site.
How it works
- Runs daily on a schedule and fetches the latest WordPress posts via the WordPress REST API.
- Keeps only posts published within the configured time window and skips any URL already logged in the n8n Data Table.
- Loads each post’s live page HTML, extracts SEO tags (title, meta description, canonical, robots, and H1), and flags issues while calculating the available title character budget.
- When the title or meta description is missing or too long, sends the post excerpt and constraints to Google Gemini to draft a replacement title and meta description.
- Posts a before/after proposal to Slack and waits up to one day for an approval decision.
- If approved, updates the WordPress post title and excerpt (used as the meta description) via the WordPress REST API, then posts a confirmation to Slack and logs the outcome. Skipped proposals are logged too, so the same post is never proposed again.
- Logs clean and manual-review cases, posts a Slack summary of the run, and runs weekly to re-check applied changes on the live site and report verification results in Slack.
Setup
- Create an n8n Data Table named
seo_fix_log with columns for url, decision, issues, old_title, new_title, old_description, new_description, decided_at, verified, live_title, and checked_at, all as string columns
- Set your WordPress
site_url, post_type, and character limits in the Config node, and ensure the WordPress REST API and permalink URLs are publicly reachable from n8n.
- Add WordPress Basic Auth (typically an application password) credentials for the REST API update request.
- Add Google Gemini credentials for the Gemini chat model used to draft title and description fixes.
- Add Slack credentials, invite the app to your target channel, and set the channel ID in each Slack message step (approval request, confirmation, daily summary, and weekly report).
Requirements
- A WordPress site with the REST API enabled and an application password for a user who can edit posts
- A Google Gemini API key
- A Slack app with the chat:write scope, invited to the target channel
- An n8n version with Data Tables
Customization
- title_max and description_max count characters; lower them for Japanese sites
- The description is saved as the post excerpt (Rank Math's default meta description). If your SEO plugin exposes its own field over REST, change the body of Update Post
- Raise hours to review older posts; the Data Table log keeps any post from being proposed twice
- Read the skipped drafts in the weekly report to tune the prompt in Draft Fixes, and change report_days to report on a different period
Additional info
This replaces an earlier, simpler version. New in this version: every decision is stored in a Data Table so no post is proposed twice, skipped drafts are kept for prompt tuning, the title limit accounts for the site name the theme appends, and a weekly run re-checks applied changes on the live site and reports the results in Slack.