Running a WordPress site in 17 languages taught us things no documentation covers. Here is what we learned building kkinvesting.io.
Polylang REST API Patterns
Polylang exposes language data through the WP REST API, but it is underdocumented.
# Get all posts in Japanese
GET /wp-json/wp/v2/posts?lang=ja&per_page=100
# Set language when creating a post
POST /wp-json/wp/v2/posts
{"title": "...", "lang": "ja", "translations": {"en": 123}}
Batch Publishing Pipeline
We publish articles in batches: write the source (Traditional Chinese) → translate → localize → publish all languages. Our Python pipeline handles:
- Markdown to Gutenberg HTML conversion
- Language-specific slug generation
- Polylang translation linking
- Rank Math SEO metadata per language
- Cloudflare cache purging
Hard Lessons
-
PUT requests get blocked by Cloudflare — Use
X-HTTP-Method-Override: PUTheader - Rate limit your batch operations — WordPress crashes if you fire too many PUT requests
-
context=editis expensive — Use_fields=id,statusfor lightweight checks - hreflang tags are critical — One mistake and Google ignores all translations
Full tutorials: kkinvesting.io
Top comments (0)