I am working on a multilingual network and I need a way to identify "the same" content for all the different versions.


Suppose a multisite called Network, under which I have a few sites:

  • Site EN-US
  • Site EN-UK
  • Site ES-MX
  • Site DE-DE
  • ... you get it

And I publish a post titled: "How to make amazing pizza".

And I want a variation for that post in another language with its own slug.

I would just go and create the posts, one for each site.

But if I want to use the hreflang attribute and maybe a language switcher, or just keep more controll over my translations, I need a reference for each of those versions. A way to pack those posts together.

I thought about creating a custom metabox with a meta filed called "variations-identifier" or something like that. But in Gutenberg metaboxes as I knew them don't exist anymore.

Also, I don't know if there is a better or even an already existing native approach for that.

The idea is to make groups of posts that belong to different subsites in the network, knowing that all the posts in the same group are talking about the exact same topic, just in different languages.

What do you suggest?

  • "But in Gutenberg metaboxes as I knew them don't exist anymore." - they do, but it's recommended to use meta block instead. "already existing native approach for that" - I don't think there is. So you could use a metadata like Polylang did (they used a meta named lang). Or better (when it comes to searching and filtering), use a custom taxonomy that you'd register network-wide so that the taxonomy is available in all sites (main and sub sites). But I'm actually not sure if I correctly understood the question..
    – Sally CJ
    Jul 13 '21 at 6:06
  • @SallyCJ Thanks for your help. "But I'm actually not sure if I correctly understood the question" from your comment it seems you perfectly got it. I will update it anyway to make it clearer. Jul 13 '21 at 8:49
  • Thank you for the clarification, and sorry, lang is actually a custom WP_Query arg and not meta key.. But then, if the subsites are already specific to a certain language/locale, then why do you still need the meta/identifier?
    – Sally CJ
    Jul 14 '21 at 5:52
  • @SallyCJ The identifier's scope is to create a relationship for posts between different subsites. So that if a user is reading a post "Whatever title" inside the subsite A, I can show him the same "Whatever title" post but in subsite B. I Jul 15 '21 at 17:48
  • In that case, then a custom table that references the related posts in all the subsites might be better? And I've never done it, but the table would store the post ID, the ID of the blog/site containing the actual posts table, and the unique identifier for each post group. But.. although possible, the querying part wouldn't be easy, so you might instead want to try an easier option like using this (paid) plugin..
    – Sally CJ
    Jul 16 '21 at 10:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.