Automatically synchronizing translations for a post's tags and categories for Polylang
Synchronize the tags and categories across all translations for a post, for all languages defined in the Polylang settings, using a Gato GraphQL automation.
![Leonardo Losoviz](/images/leo-avatar.jpg)
![Gato GraphQL logo](/_next/static/media/GatoGraphQL-logo-suki-rectangular.d3bab7ee.png)
![Target Image](/images/logos/polylang.png)
Integrations
This demo is a continuation of Automatically translating posts for Polylang, to also synchronize the translations for the post's tags and categories (in addition to translating the content).
It uses the integration with the Polylang plugin (and Polylang PRO).
In the demo video, Polylang is configured with 3 languages: English (set as the default), Spanish and French, and we have a post that has alredy been translated to all three languages (following the previous demo).
We edit the post in English, and assign tags and categories. We then execute persisted query Sync tags and categories for Polylang (already available by the Gato GraphQL plugin).
Since the tags and categories only have an English version, both the Spanish and French translation posts will not receive any of these.
Then we translate tags and categories for Spanish and execute the persisted GraphQL query again. As a result, the Spanish post will have received the corresponding Spanish translations for the tags and categories.
Finally we automate the process. By publishing automation rule Polylang: When publishing a post, set the tags and categories for each language on all translation posts, whenever the origin post in English is updated, all tags and categories will be automatically synchronized, for all translation posts.
We then translate tags and categories to French, and update the origin post in English (twice). As a result, the post in French will now have the corresponding tags and categories in French.