WPML GraphQL – Multilingual WPGraphQL for Headless WordPress
Build a multilingual headless WordPress site. WPML GraphQL adds language awareness to the WPGraphQL schema. Every query can filter by language. Every query can return a node’s translations. Multilingual menus come through the schema. Translated URIs resolve correctly. WPML GraphQL is built by the WPML team to work with WPGraphQL, the open-source plugin that Next.js, Nuxt, Astro, Gatsby, and other front-end frameworks use to read WordPress content. Included with Multilingual CMS and Agency.
Query Content per Language From Your Front-End
Every WPGraphQL query gains a language argument. Filter posts, custom post types, taxonomy terms, menus, menu items, and comments by language in a single field – no post-query filtering on the front-end, no double the request volume, no language guessing.
query PostsES {
posts(where: { language: "es" }) {
nodes { slug uri title }
}
}
When you filter a top-level node by language, connected items (categories, tags, custom taxonomies) automatically follow the same language. Results are consistent without extra arguments per nested field.
Want everything regardless of language for a sitemap or aggregate count? Pass language: "all".
Fetch Every Translation of a Node in One Query
The translations field on posts and taxonomy terms returns every other-language version of a node: slug, URI, language code, and any nested fields you ask for. One query, one round-trip, every language version of a page.
That’s the data you need for a language switcher rendered next to the page content itself, without making the front-end follow a chain of related queries.
Multilingual Menus, Taxonomies, Comments, and Language Data
Beyond posts, WPML GraphQL extends the same language argument and translation handling to:
- Menus and menu items.
menu(language: "fr")for per-language navigation. Added in WPML GraphQL 1.1.0. - Taxonomy terms. Categories, tags, and custom taxonomies follow their post’s language by default and can be queried per language directly.
- Comments. Return comments associated with posts in a specific language.
languagesanddefaultLanguagequeries. List every installed language on the site with code, locale, native name, country-flag URL, and home URL. The right data shape for a custom language switcher.
Query a Specific Post by ID or Slug, in Any Language
Two query shapes get a single translated post by its language-specific identifier:
query PostBySlug {
post(id: "hola-mundo", idType: SLUG) {
title slug uri
}
}
query PostById {
post(id: "2", idType: DATABASE_ID) {
title slug uri
}
}
Either form returns the translated post with its translated title, slug, and URI – without separate “is this a translation?” logic on the front-end.
Maintained Against the Current WPGraphQL Release
WPML GraphQL 1.1.3 is tested up to WPGraphQL 2.0.0, the major release path the WPGraphQL project is on. The team that maintains WPGraphQL works with us so the multilingual layer keeps moving with the schema. When WPGraphQL ships a new release, WPML GraphQL is right behind it.
Works With ACF When You Add ACFML and WPGraphQL for ACF
For sites that build their content models in Advanced Custom Fields and expose those fields through WPGraphQL, WPML GraphQL composes with ACFML and WPGraphQL for ACF to add a language argument to ACF Options Page queries:
query Settings {
myOptionPage(language: "de") {
addressFieldGroup {
addressTitle
repeaterAddressDetails { addressDetails }
}
}
}
ACF fields on posts and CPTs follow the host post’s language automatically.
WPML GraphQL Is Included With WPML
WPML GraphQL ships with Multilingual CMS and WPML Agency. No separate purchase, no per-site fee. Buy WPML once and your headless multilingual stack has its language layer. If you already have WPML, activate WPML GraphQL from your WPML downloads page.