0

I used to use third-party plugins (I tested both free and commercial ones) to do bi-lingual Wordpress websites, but now I want to be less dependent on third-party plugins.

Question:

Have you achieved to do a 2-language website with no plugin at all? If so, can you describe the workflow?

Example:

  • Write normal pages example.com/en/about and example.com/de/about, the first with tag english, and the second assigned to tag german

  • Add a widget with two flags. Clicking on english flag will replace current visited page's URL by the same URL with /en/ at the beginning. Clicking on german flag will replace current URL by the same URL with example.com/de/.... This should be possible with a few lines of PHP I guess?

  • Have you found a way to prevent all pages (of both languages) to be displayed at the same time in the menu? Also, how to prevent all articles (of both languages) to be displayed in the blog part?

6
  • 2
    Doing everything you will want and need will more than likely eventually require writing a plugin, so why not just use one that has already been built and thoroughly tested? Oct 15, 2021 at 7:48
  • @JacobPeattie Yes and no. I have administrated several Wordpress for years and every additional third-party plugin is a burden on the long term because of maintenance, updates, etc. Now I'm now trying to use only built-in features and some customizations.
    – jontwo
    Oct 15, 2021 at 8:58
  • @JacobPeattie My bullet 2 can be done easily myself in few PHP lines. I now notice the problem comes down to the following: is there are a way to define a global "variable" (ex: $lang = urlBeginsWith('/en/') ? 'english' : 'german') and then, based on this variable, 1) *display only pages with tag english in the menus and 2) display only articles with tag english in the blog part. Maybe is there a built-in way to display only articles/pages with a certain tag? If this is possible, I can totally avoid a multilingual plugin.
    – jontwo
    Oct 15, 2021 at 9:03
  • 5
    I think you’re dramatically underestimating the work that will be required to do this properly. Oct 15, 2021 at 9:12
  • 4
    This is pure plugin territory. So either you have to use an existing plugin or write one for yourself. Good luck with the latter, it's an insane amount of work.
    – fuxia
    Oct 15, 2021 at 10:39

2 Answers 2

1

It's possible to achieve this with WordPress Multisite feature. I did this before - with "subfolder" settings, you can create two websites (with one WP instance), example.com/en/ and example.com/de/ ...

But I did it only once when I didn't know better. And it was pain in the ... to maintain. Then I found Polylang plugin, and I never looked back. I use it on some websites for many years with no issues, it just works.

1
  • Was going to suggest Multisite - the problem is that posts are not really connected. So you can't easily switch between German and English and get the same post. As far as I know MultilingualPress solves this gap. But its a plugin
    – kero
    Oct 15, 2021 at 11:48
1

If you really want to create a multilingual site without plugin, the simplest is to have 2 separated wordpress installation in different subdomain or subfolder (like mysite.com/en and mysite.com/de).

Then for each post or page (or any post_type you want translatable), add a custom metabox with an input for the url of the other language site. Then create a widget displaying a link using this custom meta key.

The pro of this approach is of course the simplified maintenance but the con is that it will almost double the work of editing. Want to add an image? You'll need to add twice. Reorder menu items? Double work. Change a permalink? Also need to change the language link in the other installation...

You get the point: the main challenge is not to make the content of a site translatable, it is to make it "untranslatable". That means the ability to synchronize all the things that should be identical in both languages. That is basically where the complexity of every multilanguage plugins lies.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.