Skip to content
Article

How We Built an AI-Powered Article Pipeline With Claude Code and WordPress

This article was written, SEO-optimized, translated to French, and published to production — entirely by a Claude Code agent. Here’s exactly how we built it.

 
Claude Code WordPress automation pipeline

Why We Built Claude Code WordPress Automation

Publishing a blog article on a WordPress site sounds simple — until you factor in Elementor layouts, Yoast SEO optimization, bilingual translations, and a multi-environment promotion pipeline. What should take 30 minutes takes half a day.

At Sengo, we asked: can a Claude Code agent handle the entire workflow? Not just write the content — but create the draft in WordPress, set the Elementor layout, configure Yoast meta, insert French translations, and promote from local to staging to production?

The answer is yes. And this article is the proof — it was created end-to-end by the same Claude Code automation pipeline it describes.

 

What the Claude Code WordPress Pipeline Does

The pipeline handles every step of article creation and publishing:

  • Content generation: writes the full article body, intro, headings, CTAs — optimized for Yoast SEO from the start (keyphrase distribution, outbound links, subheading optimization)
  • Elementor layout: builds the JSON structure for the 50/50 intro row (author box + featured image), separator, and 33/66 body row (Joli TOC sidebar + article content)
  • Yoast SEO meta: sets title, description, focus keyphrase, Open Graph, and Twitter cards — updating both wp_postmeta and wp_yoast_indexable tables
  • French translations: generates natural fr_CA translations and inserts them into TranslatePress dictionary tables, including slug translations
  • SEO tags: selects from existing tags and creates new ones aligned with Sengo’s positioning
  • Multi-environment promotion: local → staging → production, with full data transfer via a custom REST API

 

The Architecture Behind Claude Code WordPress Automation

Three components make this work:

1. Claude Code Skills (Slash Commands)

We defined custom skills as markdown files in .claude/skills/. Each skill is a detailed playbook that Claude Code follows:

  • /content-create — gathers a brief, writes content, builds Elementor JSON, creates the draft, sets all SEO meta, inserts translations
  • /content-publish staging 7316 — exports a post from local, resolves tags and authors on staging, creates the draft, sets Elementor + Yoast + translations via API
  • /content-publish prod 7692 — promotes from staging to production following the same flow

The skills contain every rule the agent needs: Yoast SEO optimization guidelines, Elementor structure definitions, TranslatePress table schemas, and environment-specific behaviors.

2. Sengo Agent REST API

WordPress’s standard REST API can’t write Elementor data, Yoast indexable entries, or TranslatePress translations. So we built a lightweight custom API — three endpoints in a single PHP file (facilio-child/inc/sengo-agent-api.php):

  • POST /wp-json/sengo/v1/elementor/{id} — sets Elementor layout data and clears cache
  • POST /wp-json/sengo/v1/yoast/{id} — updates both wp_postmeta and wp_yoast_indexable
  • POST /wp-json/sengo/v1/translations — inserts dictionary entries and slug translations

All endpoints require Application Password authentication. The same API works identically on local, staging, and production — no environment-specific code paths.

3. Environment Pipeline

Content flows in one direction: local → staging → production. Each environment has its own WordPress instance with separate post IDs, tag IDs, and users. The pipeline resolves everything by name, not ID:

  • Tags are matched by name and created if missing
  • Authors are resolved by display name
  • Elementor data, Yoast meta, and translations are re-applied via the Sengo Agent API on each target

 

How Claude Code Handles Yoast SEO Optimization

Getting a green Yoast score isn’t an afterthought — the Claude Code agent applies SEO rules during writing, not after. The skill file includes 11 Yoast optimization rules:

  • Focus keyphrase in at least 2–3 H2 subheadings
  • Keyphrase distributed evenly across sections (not clustered in the intro)
  • 2–3 outbound links to authoritative sources
  • 1–2 internal links to related sengo.com pages
  • SEO title with keyphrase at the beginning (≤60 chars)
  • Meta description ≤156 characters with keyphrase
  • Slug containing keyphrase words
  • 1000+ word article body
  • Keyphrase in image alt text

The result: articles that score green on Yoast from the first draft, without manual SEO tweaks.

 

Bilingual WordPress Content With Claude Code Automation

Sengo’s site runs English and French via TranslatePress. The agent handles both:

  • Content translations: all visible strings (headings, paragraphs, CTAs) are translated to natural fr_CA and inserted into the TranslatePress dictionary via API
  • Yoast meta translations: SEO title, meta description, and OG fields get dedicated FR versions
  • Slug translations: the URL slug is translated (e.g., claude-code-wordpress-automationautomatisation-wordpress-claude-code) via the slug translations table

No manual entry in the TranslatePress visual editor required — the API handles everything.

 

What We Learned Building Claude Code WordPress Automation

A few things surprised us during development:

  • Yoast uses two tables. Writing to wp_postmeta alone doesn’t work — Yoast reads from wp_yoast_indexable first. Our custom API updates both.
  • Elementor data isn’t accessible via REST. The standard WP API registers the meta but can’t read or write it. A custom endpoint solved this in ~30 lines of PHP.
  • PHP 8.2 JIT causes segfaults. OPcache JIT tracing mode crashed Apache with Elementor + TranslatePress. Disabling JIT fixed it instantly.
  • AIOS blocks REST API on production. The All In One Security plugin blocks unauthenticated API access. Application Passwords work, but only if the user’s role is in the AIOS allowed list.
  • Cloudflare needs a User-Agent. API calls without a User-Agent header get blocked by Cloudflare’s bot protection.

 

Try It: Set Up Claude Code WordPress Automation

Here’s what you need to replicate this pipeline:

  1. Claude Code CLI — install from Anthropic’s docs
  2. WordPress with Application Passwords — WP 5.6+ has this built in. Create a dedicated API user.
  3. Custom REST endpoints — a single PHP file for Elementor, Yoast, and TranslatePress writes
  4. Claude Code skills — markdown files in .claude/skills/ that define the workflow rules
  5. Environment config — a JSON file mapping local/staging/prod URLs, credentials, and capabilities

The entire setup took us one working session to build and refine. The ROI is immediate — every article after this one follows the same pipeline with a single command.

 

Want Sengo to set up an AI content pipeline for your WordPress site?

Book a free consultation →

Sengo Robot  Nikko
I Co-wrote this with a human 😉