Automating content publishing sounds simple: an AI generator writes the article, you push it to WordPress via an API call, and you’re done. In real life the biggest risk isn’t technical — it’s quality. If you treat automation as a single integration, you’ll eventually ship thin, repetitive posts that hurt trust and don’t perform in SEO. The good news: you can automate publishing in a production‑grade way, as long as you build a process with quality gates.
This guide describes a practical pipeline: AI generator + validations + WordPress API + Unsplash featured images + bilingual posts (Polylang) + mandatory internal linking. The goal is boring reliability: it should work every day without manual firefighting.
Why publishing automation often reduces quality
Most “AI content factories” fail for predictable reasons:
- No clear intent — the post is vague and doesn’t answer a specific user question.
- Fact issues — AI can sound confident while being wrong. In software, that’s expensive.
- Duplicate angles — repeated topics, no editorial strategy.
- Inconsistent style — each post reads like a different author.
- No internal linking — you lose an easy SEO lever.
- No visuals — posts feel empty; CTR and engagement drop.
Automation doesn’t cause those problems — lack of process does.
The target pipeline: how it should work
A solid publishing flow looks like this:
- Input: a topic from a backlog + primary keywords + category + tags + target length (e.g., 2,000 words).
- Generation: AI produces the article (PL and EN) in a structured data format (JSON).
- Validation: automated checks enforce minimum quality (structure, length, duplicates, links).
- Enrichment: pick a featured image (Unsplash), append an internal link if missing, build an excerpt.
- Publishing: WordPress API creates a draft, assigns categories/tags, attaches the image, links translations (Polylang).
- Review: a 2–3 minute human glance, then publish.
Start with drafts. Publishing directly makes sense only after you’ve proven stability and monitoring.
Data contract: one JSON per post (PL + EN)
Instead of “clicking WordPress”, the generator should return structured data. A minimal contract could look like:
{
"title": "...",
"slug": "...",
"content": "<p>...</p>",
"excerpt": "...",
"status": "draft",
"categories": ["AI"],
"tags": ["automation", "ai"],
"unsplashQuery": "automation workflow",
"internalLinkQuery": "wordpress publishing automation",
"en": {
"title": "...",
"slug": "...",
"content": "<p>...</p>",
"excerpt": "...",
"status": "draft",
"categories": ["AI"],
"tags": ["automation", "ai"],
"internalLinkQuery": "wordpress publishing automation"
}
}
This makes the rest of the pipeline deterministic and testable. If something breaks, you fix the generator or a validator — not random posts in the editor.
Publishing drafts via WordPress REST API
The mechanics are straightforward:
- get a JWT token from your token endpoint,
- create the PL post using
/wp-json/wp/v2/posts?lang=pl(draft), - create the EN post using
/wp-json/wp/v2/posts?lang=en, - link translations via a dedicated endpoint,
- upload media and set
featured_mediafor both posts.
Once scripted, publishing becomes a single command on your machine.
Featured image via Unsplash
Posts without a featured image often underperform. A pragmatic approach:
- Let AI output
unsplashQuery(e.g., “automation workflow”, “ai abstract”). - Pick one image from Unsplash via API.
- Upload to WordPress Media and set it as
featured_media.
Tip: keep the query broad and professional; avoid overly literal “people photos” unless you control brand consistency.
Polylang: bilingual posts in one run
Automation is especially valuable for multilingual blogs. Two practical notes:
- Categories/tags: multilingual WP often keeps separate terms per language. Use
langto resolve the correct term IDs per language. - Translation links: link PL and EN drafts right after creation so they show as a pair in the admin UI.
Internal linking: enforce at least one link
Every new article should link to at least one existing post — same language only (PL→PL, EN→EN). Do it properly:
- descriptive anchor text,
- relevant topic,
- avoid random “link stuffing”.
In the pipeline, keep an index of published posts and choose the best match based on keyword overlap + shared categories. If the generator already added an internal link, keep it. If not, append a “Read also” block automatically.
Quality gates: cheap checks that prevent embarrassing drafts
Even strong prompts will occasionally produce weak output. Add minimal validations:
- Length: enforce a range (e.g., 1,800–2,300 words for a 2,000‑word target).
- Structure: one H1, at least 3–6 H2 headings, lists, summary.
- Forbidden claims: no “guaranteed rankings”, no clickbait.
- Fact discipline: if numbers/stats appear, require a source link or remove them.
- Internal link: at least one, same language.
- Duplicates: slug must be unique; avoid near‑duplicate topics in the last N posts.
How to run it locally (no infrastructure required)
A local setup can be very simple:
- A topics backlog file (PL/EN topic, keywords, category, tags, Unsplash query).
- A generator script that produces the JSON payload.
- A publisher script that creates bilingual drafts in WordPress.
Once the fundamentals are stable, you can add scheduling, logs, and alerts — but you don’t need them to start.
FAQ
Can I publish directly (without drafts)?
Yes, but only after you’ve proven stability. Start with drafts + quick review. That is the safest way to maintain quality.
Is this SEO‑friendly?
Yes, if the content is genuinely helpful, well‑structured, and includes internal links. Automation is just the production method; search engines evaluate usefulness and consistency.
What about SEO plugins (e.g., Rank Math)?
Some plugins or plans restrict SEO meta manipulation via API. Even without that, you can still win with intent, structure, and internal linking.
Summary
Automated publishing works when you treat it as a pipeline: topic → generation → validation → enrichment → bilingual drafts → review → publish. Add featured images, link translations, and enforce internal linking. That’s how you get speed without sacrificing quality.
If you want, we can turn this into a repeatable daily process: the AI generator produces a single JSON for PL+EN, and a local script publishes drafts with Unsplash images and relevant internal links.
Read also: Claude Code – A Revolution in Business App Development Automation
