Skip to content

Instantly share code, notes, and snippets.

@InpsydeNiklas
Last active June 28, 2026 18:25
Show Gist options
  • Select an option

  • Save InpsydeNiklas/b95bdffc45c8ede701fc3700d0541cfd to your computer and use it in GitHub Desktop.

Select an option

Save InpsydeNiklas/b95bdffc45c8ede701fc3700d0541cfd to your computer and use it in GitHub Desktop.
Basic Multilingual(?) WordPress Playground Blueprint
{
"landingPage": "/",
"preferredVersions": {
"php": "8.2",
"wp": "latest"
},
"steps": [
{
"step": "login",
"username": "admin",
"password": "password"
},
{
"step": "runPHP",
"code": "<?php\nrequire '/wordpress/wp-load.php';\n\n$existing = get_posts(['post_type'=>['post','page'],'post_status'=>'any','numberposts'=>-1]);\nforeach ($existing as $p) { wp_delete_post($p->ID, true); }\n\nwp_insert_post(['post_title'=>'English Page','post_name'=>'english-page','post_content'=>'<!-- wp:paragraph --><p>This is an English placeholder page. Replace this text later.</p><!-- /wp:paragraph -->','post_status'=>'publish','post_type'=>'page']);\n\nwp_insert_post(['post_title'=>'Página en Español','post_name'=>'pagina-en-espanol','post_content'=>'<!-- wp:paragraph --><p>Esta es una página de marcador de posición en español. Sustituye este texto más tarde.</p><!-- /wp:paragraph -->','post_status'=>'publish','post_type'=>'page']);\n\nwp_insert_post(['post_title'=>'Why WordPress Needs a Multilingual Plugin','post_name'=>'why-wordpress-needs-a-multilingual-plugin','post_content'=>'<!-- wp:paragraph --><p>WordPress does not include native multilingual support. Beyond translating its own interface strings, core has no concept of &#8220;this post is the German version of that post&#8221; and no built-in language switching. Multilingual support is on the <a href=\"https://wordpress.org/about/roadmap/\">long-term roadmap</a>, as the goal of the project&#8217;s fourth development phase, after the block editor, the site editor, and collaborative editing, but it is not expected to land for some time. Until it does, every multilingual WordPress site relies on a plugin or custom development.</p><!-- /wp:paragraph --><!-- wp:paragraph --><p>You can prove the gap to yourself in a few minutes: create an English page and a German page in a stock WordPress install and you immediately hit the limits. The two pages share the same header, navigation menu, and footer in a single language; nothing links them as translations; and there is no language switcher or hreflang. It works for a tiny static site and falls apart the moment the site grows. Everything a multilingual plugin does is, at bottom, solving the six problems above on your behalf.</p><!-- /wp:paragraph -->','post_status'=>'publish','post_type'=>'page']);\n\nwp_insert_post(['post_title'=>'English Post','post_name'=>'english-post','post_content'=>'<!-- wp:paragraph --><p>This is an English placeholder post. Replace this text later.</p><!-- /wp:paragraph -->','post_status'=>'publish','post_type'=>'post']);\n\nwp_insert_post(['post_title'=>'Entrada en Español','post_name'=>'entrada-en-espanol','post_content'=>'<!-- wp:paragraph --><p>Esta es una entrada de marcador de posición en español. Sustituye este texto más tarde.</p><!-- /wp:paragraph -->','post_status'=>'publish','post_type'=>'post']);\n\nupdate_option('blogname', 'My almost multilingual WordPress Website');\n\n$blog_page_id = wp_insert_post(['post_title'=>'Bilingual Blog','post_name'=>'bilingual-blog','post_content'=>'','post_status'=>'publish','post_type'=>'page']);\nupdate_option('show_on_front','page');\nupdate_option('page_for_posts', $blog_page_id);\n\necho 'Done.';"
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment