The No-Plugin Guide for a Multilingual WordPress Site Using Multisite

The No-Plugin Guide for a Multilingual WordPress Site Using Multisite

It’s easy to forget that the internet is a World Wide Web. Which means that people from all over the world have access to your website. So, if you only serve content in one language, you’re at a potential disadvantage.

Communicating with an international audience through a multilingual site has its perks. Not only can it bring new customers your way, but it can also give you a competitive edge. If there is a potential multilingual market for your business and your competitors are not taking advantage of that, you could! After all, creating a multilingual WordPress site is not very hard when you’ve got so many plugins to choose from.

But not so fast, my plugin-addicted friends! For this particular feat, I’ve decided to move away from the plugin-laden world of multilingual websites and venture into the Multisite side of things. I want to show you how to create your own multilingual WordPress site…from scratch! Creating a multilingual WordPress site using Multisite has many advantages, of which ultimate control is one. It allows you to create, tweak, and present your translated content however you want.

And I promise it’s not as painful as it sounds.

Creating a Multilingual Multisite

The power of the multilingual (and plugin-less) experience lies in the WordPress Multisite feature. Since WordPress Multisite allows you to create multiple sites using the same WordPress installation, it means you don’t have to fidget with endless WordPress configurations whenever you want to add or tweak a new language.

Even though I’m French Canadian, I have yet to implement a French version (sacrilège!) of my website, so I’ll be coding along with you. If you’ve already gone through the steps of our in-depth Multisite guide, you can skip this section.

Configuring wp-config.php

Okay, so the first step to creating a Multisite from an existing website is to navigate to your WordPress installation directory to locate the wp-config.php file. I use HostGator, so my directory is under the cPanel File Manager. Once you’ve located the file, open it in a code editor and search for the /* That's all, stop editing! Happy blogging. */ line.

wp-config file
The wp-config.php file is fairly easy to navigate.

Right above the line, add the following value:

define( 'WP_ALLOW_MULTISITE', true );

Then save the file. Keep your file manager open, as we’ll return to it a little later.

Configuring the WordPress Admin Panel for Multisite

Access your admin panel and select Tools and then Network Setup. For this step, you’ll need to deactivate your plugins briefly in order to set up the network. Just click on the hyperlink when you’re prompted.

Multilingual Multisite plugin prompt
Click the hyperlink to deactivate your plugins.

After you finish this step (which takes less than a minute), don’t forget to reactivate them!

Enter the title of your network (I chose “Ioana Dragnef Sites”) as well as the site’s administrator email, and click Install.

After the installation is completed, you’ll see the network installation screen. You’ll need to head back to your WordPress directory to make a few more edits to the wp-config.php and .htaccess files. If you’re a fan of shortcuts (like me!) WordPress provides you with the required code, so all you have to do is copy and paste in the required places.

Multilingual Multisite network of sites
Copy and paste the supplied code.

After you edit the two files, click the hyperlink at the bottom of the page that asks you to log in again. Once you log in, you should see the Multisite dashboard.

Multilingual Multisite dashboard
The My Sites menu allows you to manage multiple multilingual sites.

Setting Up a Subdomain

After setting up your Multisite, the next step is to set up a subdomain. A subdomain is part of your parent domain while the subdirectory is a folder within it. For instance, fr.ioanadragnef.com is a subdomain, while ioanadragnef.com/fr is a subdirectory. If you need a quick refresher, we’ve covered the difference between Multisite subdomains vs. subdirectories in a previous post.

So, I’m going to set my up my website so that my French users can see their language code as a subdomain (i.e. fr.ioanadragnef.com). And since my WordPress site has been set up for over a month, I have to use the subdomain option.

You can set up a subdomain from either your hosting provider or from within WordPress. If you do it from within WordPress, you’ll need to change some DNS records along the way.

Setting Up a New Site and Subdomain

I’m going to create a French version of my site by going to My Sites > Network Admin > Sites, and selecting Add New.

Enter the fields at the prompt and choose a subdomain for your new site. If you’re making a multilingual WordPress site, it makes sense to have the subdomain be the language code (e.g. fr for French) but you can make it whatever you want.

Add your chosen language subdomain to your new site.

Be careful not to change the site language if you don’t speak the language you’re switching it to. This will only change the language of your site dashboard.

Once you’ve added the site, you should see it in the My Sites drop-down menu. You can manage it the same way you do the other by adding plugins, themes, and content.

Setting Up a Wildcard Subdomain

In order to use subdomains properly, you’ll need to set up a wildcard record (*.domain.com) in your DNS records. You can change this wherever you host your site or wherever you bought your domain from (i.e. your domain registrar).

I use HostGator, so all I had to do was navigate to the cPanel, select the Subdomains section, and fill out the following fields:

Hostgator domain
Simply adding an asterisk (*) as the subdomain will automatically set the wildcard document root.

If you need an extra hand with domains and subdomains, you can contact your web host directly or look into our domain mapping services.

Installing Your Theme

Once you’ve configured your subdomain, you’ll want to install the theme of your main website to your other-language site. I don’t recommend using a separate theme for your other-language site, as that approach tends to be more time-consuming and often confusing to your visitors.

I’ve used the same theme on my French language website as my English website. Except my French website looks a little bare! So the next step is to translate and add my content.

Adding Your Content

My website is fairly succinct, so luckily there aren’t a lot of pages to add and translate. However, if you’ve got a lot of pages you want to transfer to your new language website, there are shortcuts—you can use a Multisite post duplicator.

Duplicator plugins allow you to clone individual pages and transfer them over to your new site. Since I’m translating my content manually, tools like these are very helpful. I just duplicate the existing structure, content, and plugins, and then go in and replace the English text with the French text.

Here is a list of content duplicator plugins you can use to help you speed up your Multisite building process:

Translating Your Content

So now you have a Multisite, a subdomain, you’ve configured your content and website structure, and now you’re ready to get translatin’!

While there is no match for human translators when it comes to details and nuance, they also tend to come with a very high price. Luckily, there are a couple of good WordPress plugins that you can use to facilitate the process. We’ve covered them extensively in a previous post, but in case you missed it, here’s the full list:

Configuring Custom Menus

Once your website is ready and translated, all you have to do is add it to your original-language website so that users can switch back and forth!

To do this, we’ll be creating a custom menu. Since I’m only using a single language, I just want to link to the French-language version of the website within my own menu. So, I’m creating a custom link within my website’s primary menu.

From Appearance > Menus, I’m just going to edit my main menu.

Under Custom Links, I entered the URL of my subdomain and the navigation label and just added the custom link to the menu via the Add to Menu button:

Custom links
Custom links within your existing site menu are best if you’re only using a single language.

Custom Menu for Multiple Languages

If you want to create a menu that contains multiple languages, simply create a new menu and add multiple custom links with the various language subdomains.

For example, if I want a Languages menu that encompasses both French and Spanish, first I’ll create a new Languages menu.

Custom links
Custom links within your existing site menu are best if you’re only using a single language.

I’ll then add my French and Spanish subdomains under a different custom link and use the name of the language as the navigation label.

Wrapping Up

Congratulations! You now have a Multisite, a subdomain, and a custom menu working to direct your readers to the appropriate site. Having a multilingual WordPress site allows you to reach more readers and potential customers than ever before. Now, when visitors view your site, they will be able to view it in English or select another language appropriate to their needs. Plus, since you’ve created your multilingual sites via Multisite, you have more control and customization options than if you had used a plugin.

Given the right circumstances, a multilingual WordPress site can make you look more professional and opens you up to new opportunities and leads. Don’t miss this chance to expand your audience in just a few simple steps.

Ioana Dragnef
What do you think about this way of implementing a multilingual site via Multisite? Would you still prefer to use plugins? Would you be tempted to try it out on your own site? Let me know in the comments below!