This is a tutorial on how to set up TranslatePress, if you haven't installed it yet, click to download it!TranslatePress BusinessPlugin. TranslatePress (TP for short) is the best translation plugin in our mind, and it is also one of the few plugins that we have found that can use the auto-translation function in China with SEO effect and support manual modification of translation.
You can insert a language switcher in the navigation bar, it's Elementor compatible, and you can set any content to be shown/hidden in certain languages in the ele editing interface. The English version of this site is also made with TranslatePress Business. We think TranslatePress is the most suitable solution for WordPress websites in mainland China.
TranslatePress Setup Tutorial
Click "Settings" under "Translate Site" on the top bar of the website to enter the settings interface.
First, enter the "Additional Functions" setting. active (open) The following figure ↓ 4 functions, other functions please decide whether to open according to the actual situation.
Seo Pack:Recommended to be enabled to make translated languages SEO effective. Translate small language SEO titles, SEO descriptions, URLs, set HTML lang attributes, and SEO support for facebook and twitter social graph messages. Make small languages SEO effective and rank better. Click onView Details. Multilingual sitemap supports all popular SEO plugins: Yoast SEO, Rank Math, AIOSEO, SEOPress.
Multiple Languages:It is recommended to enable it to add multiple translation languages, without it you can only add one.
DeepL Automatic Translation:Enabled to use DeepL automatic translation function, domestic can be used, not blocked. It is called neural translation, translation accuracy Google Translate high. Continental region credit card can not register to open DeepL api, need to go to Taobao to spend 39 or so to buy a lifetime valid free api. if you use Google auto-translate, this function does not need to open.
Browse As User Role:It is recommended to enable the ability to switch user identities in the manual translation screen so that dynamic page content based on logged in/unlogged out status can be viewed and translated.
Automatic user language detection:Enable the ability to pop up a language selection box based on the visitor's IP address and browser language, allowing the visitor to choose which language version of the page to enter. You can also set it to automatically enter the corresponding language version of the page based on the visitor's IP address and browser language (without having to select a language first).
Page loading will be much slower when enabled, not recommended.
Next, go to the "General" section and set the settings as shown below.
1 is the default language of the website, 2 select the new language you want to add and press 3 to add the language.
Formality is the setting DeepL translationd whether the language is on the colloquial or formal side, click to see theelaborate. The default is Default, leave it alone.
Set up as below↓, remember to click "Save Changes". Among them, "Use subdirectories for default voice" must be selected.cloggedOtherwise, the default voice main domain name will be added after the domain name abbreviation suffix, it is difficult to see may also lead to the error URL error page can not be opened.
The "Advanced" section allows you to modify some compatibility settings as well as enhance translation functionality, so if you have problems using it or want to implement some additional functionality, take a look in this section. By default, it is not recommended to modify the settings here, we have used this plugin in several sites without any problems. So far the plugin has been set up and can be used normally. More setup details pleaseView the official TP documentationIf you need to translate manually or correct the translation result manually please see the tutorial below.
"Disable dynamic translation"It is recommended to check the box to enableThis can improve page performance and speed while reducing server pressure. If you can't translate some text on the front-end, uncheck the box to see if it's working again.
Exclude certain pages and content from being automatically translated
automatic translation
Go to Automatic Translation section, select "Yes" for "Enable Automatic Translation", select translation engine for "Alternative Engines", only select "Google Translate v2" or "DeepL". The first "TranslatePress AI" requires an additionalPurchase of official translation servicesOnly then can you use it, it's expensive, don't pick it!
The following figure is the interface after selecting "Google Translate v2" ↓, enter the translation api, tap "Save Changes".
The following figure is the interface after selecting "DeepL" ↓, select the api type and input the translation api, tap "Save Changes".
With regard to automatic translation: each character is translated only once.The same content is translated only once, and the translation resultPermanently stored in a database. One Chinese character = 2 characters, one English letter = 1 character (e.g. apple word counts as 5 characters), invisible characters such as spaces, tabs, line breaks, etc. are also counted as characters. 500,000 characters ≈ 150,000 Chinese characters.
DeepL is relatively simple and easy to use, the translation accuracy is higher, the cost is very low, the mainland can be used, the disadvantage is that it supports very few languages (does not support Simplified Chinese). Google Translate registration trouble need to bind the credit card and can not control the amount of consumption, the mainland can not be used, the only advantage is to support very many languages.
Google Auto Translate is now free for the first 3 months of a newly registered account (the official policy may change at any time, please check), and after 3 months it will start charging for exceeding the free amount. Google Auto Translate is not available on mainland servers, but it supports a lot of voices!
Note: Try not to enable the "auto-translate slug/URL" feature, it is incompatible with some plugins that shorten/change page URLs, which can cause multilingual pages to fail.
If you set more than 4 languages, the number of words in the article will easily exceed the translation quota, toNote the remaining amount of free translation characters.
DeepL automatic translation
If the server in the mainland, you can only choose DeepL translation (Google is blocked), fill in the DeepL free API Key (Pro Key is also OK) point to save the site will automatically begin to translate, after 2-3 minutes to go to the front desk to switch to other languages can see the page content has been translated. If the weight of your site itself is good, after 10 minutes or so, the multi-language version will be indexed by the search engine, and can be searched through the URL.
Note: DeepL translations only support26 languagesThe Arabic language is not supported,traditional Chinese(Google Translate support) and so on. DeepL free API Key is free for the first 500,000 characters (about 250,000 Chinese characters) every month, and no money will be deducted for stopping the translation in excess of the quota, and the quota will be restored automatically next month to start continuing the translation automatically.
DeepL free API Key canSign up for free with a foreign credit cardYou can also go to Taobao to buy it. Attention:DeepL free APINow that the wind control has become stricter, there is a risk of blocking the number, butWe bought a couple and used them for a couple years without getting blocked.Ask the business warranty period before purchase, general warranty 30-60 days, during the lapse will make up the new key.
Taobao prices change often, the cheapest time a few dollars, expensive time go to 39 or so. We don't have recommended merchants, so please shop around for yourself.
If you can't sign up for a free API Key, and the site has a lot of content, we recommend that you buy a month's worth of Pro API Key from Taobao (no limit on the number of words you can translate) and finish translating the whole site. Then switch to the following tutorial Yandex translation tutorial to manually translate the new content (not much new content, not many languages, if the translation is also quite fast).
Ask customer service before you shoot! Make it clear that you want to buy Deepl api free account, directly send the account password to your own login, view api kind of account. Have money to buy Pro API is also OK.
Using the DeepL translation API sometimes results in the Languages without formality error shown below, indicating that certain languages are not supported (this problem does not occur with the Google Translate API). It means that these languages are not supported by DeepL translationformal/informal functionThe function is to set whether the translated language is on the colloquial or formal side.
Click "Recheck Supported Languages" to detect the general prompt will disappear, if the prompt does not disappear directly ignore it. If you really want to eliminate this prompt, and the server is abroad, we recommend using Google Translate API.
weI've asked official customer service.If you want to use the "Default" option for all languages in the General Settings, you can do so, as long as Languages without formality does not affect the automatic translation.
Google Auto Translate
If the web server is in a foreign country, you can use Google Translate, which supports more than 80 languages, click to enterFree Google Translate API Registration Tutorial. Google Translate is free for the first 500,000 characters per month and charges $20 for every 1 million characters after that, click on theView Billing Rates. The first 3 months are free for new registrants, so feel free to toss it in.
Google translate api registration is very troublesome, need to bind the settlement account (so that more than the quota can deduct money). After opening Google Translate API must set up a HTTP referrer and quota and consumption threshold reminders, always grasp the consumption situation to avoid being deducted large amounts. Diamo suggests that newcomers use DeepL API Free is more convenient.
After saving, if the API is correct, it will show the green mark in the red box in the figure below, if it indicates an API error, click "Test API credentials" to see what is wrong with the API and then correct it yourself.
Stop the crawlers:Set it as desired, without enabling it the crawler will trigger automatic translation, which helps to speed up translation in other languages.
Other settings as per the picture. If you use Rank Math, Yoast and other plugins to delete the URL prefix/base of Woocommerce product listings and detail pages, be sure not to check Automatically Translate Slugs! Otherwise, the listing page and product detail page will not open. For the specific reasons, please move to the following "Frequently Asked Questions and Solutions".
Yandex Automatic Translation
In addition to using the API for automatic translation, it is also possible to install the freeAutomatic Translate Addon For TranslatePressHelper Plugin ImplementationspeedyTranslate. This plugin will be available in the TranslatePressmanual translationThe interface has a new automatic translation button, which can be used after clicking theYandexAutomatically translates the current page so that you don't need to manually translate each entry, which is very convenient.
Note: This plugin will not translate automatically, you must go to the manual translation interface and click the automatic translation button to translate the whole page automatically. You need to do this for every page and every language, and remember to save the translation after each translation.
If you can't get Google and DeepL auto-translation API, it's good to use this plugin for semi-automatic translation. It doesn't take too much time if there aren't many pages on the site.
How to translate/correct translations manually
Generally, the translation of professional terms, company/brand names, etc. is not very accurate, especially in English to Chinese translation. It is recommended to enter the manual translation interface to check the translation result after the automatic translation is completed, and correct the wrong translation.
Different languages have different text lengths, and languages with long words such as French may be typographically incorrect due to the length of the content. After translation, it is necessary to check the display effect of each language, and manually correct the translation of shortened content in the wrong language.
Click on "Translate Site" at the top of the website background to enter the translation interface.
After entering the translation page and clicking on the content to be translated, the translation interface of the content will pop up on the left, so you can directly modify the translation and click save. (Click on the picture below to enlarge it and make it clearer)
If you want to translate Seo title, meta description and so on, directly click the red "Select the string to be translated...". If you want to translate seo title, meta description and so on, just click the red "Select string to translate...", it will popup window to translate the content, manually click to select title, seo description and so on. Then input/update the translation result. Under "Meta Information" is SEO title, description and so on.
Enter the desired translation result in the other languages box and tap "Save Translation" to save it.
Click on "String Translation" (String... in English). Go toWeb site translationInterface. As mentioned above if you remove the url prefix base from the product listings and details pages, you can't translate the url or the page won't open showing 404.
If you haven't modified the URL structure and want to manually translate/modify the URL translation result, please refer to the following picture. Tap 1 to select the content to be translated, tap 2 to "edit" the translation content, enter the translation result in 3, and tap 4 to save.
Frequently Asked Questions & Solutions:
For more tutorials and FAQ suggestions check outofficial documentIf you can't find the answer in the documentation, go toOfficial ForumFind the answer to the appropriate question, or post an inquiry, and customer service will respond within 1-2 days.
1- Product list page, detail page and other pages can not be opened
If you use the romve base (shorten url) function of Rank Math, ProYoast, Permalink Manager and other plugins to change the page url, and TranslatePress has enabled auto-translate url slug, it will result in the display of the corresponding page in other languages to be incorrect.
This is a bug, I contacted TP and Rank Math plugin support and they said it's not compatible. The solution is to disable url auto-translation by unchecking "Settings" > "Auto Translate" > "Automatically Translate Slugs" in TP.
If the product list page/detail page links are not restored to the default language after disabling the translation, it may be because they have been translated before and the old translation has been saved. You need to enter the manual translation page, click "String Translation" or "String Translation" in the lower left corner, delete the translation results of other languages of the product list page and detail page title, and then click Save. After clearing the cache and refreshing the front page, it should be displayed normally.
The impact of untranslated Url on SEO is negligible, basically negligible. Chinese website URLs are basically pinyin or English, English website images or page URLs are also a lot of numbers or letters named, basically does not affect SEO.
Update April 10, 2022: The new version of Rank Math 1.0.86.2 is compatible with WPML's auto-translate url slug feature, which is still not TP-compatible, but sees a little light. I've sent this issue back to Rank Math and they replied that they're already working on a fix.
2- Failure of automatic translation, slow translation
Generally, the translation will start automatically after you input the api in "Auto Translate", and there will be a number displayed in "Characters Translated Today", and the translation will be finished soon if there is not much content. If some languages are still not translated after a few hours, it is because the website has no visitors and the translation is not triggered.
I asked the official customer support about this and below is Alex's response. Simply put, someone needs to visit the front-end multilingual page to trigger the auto-translation, for example, when a visitor visits the German version of the front page of your website, the back-end will start to automatically translate the front page into German. If no one has been visiting the German version of the homepage, the homepage will not be automatically translated into German.
If your website translation is slow, you can turn on your browser incognito mode and visit the front-end multilingual version of the website page by page to trigger automatic translation.
If the number of characters translated today is always 0, there may be a problem with the API (e.g., exceeding the translation quota) or with the website, so check it yourself.
Let's share a case study: a customer feedback that the automatic translation suddenly failed. We have used TP Translator plugin deeply in several sites without any problem, the first feeling is that there is something wrong with his translation key.
Go to TP Translator plugin Settings>Automatic Translation, click that test button under Key, and found that it is Google Translate key that is out of order.
3- Tips for Languages without formality
We're up here.DeepL automatic translationThis problem is explained in the settings, and it occurs because some of the translated languages do not support DeppL translations.formal/informal function (Google Translate API doesn't have this problem). These hints do not affect the automatic translation function, only whether the translation result is on the colloquial or formal side.
Click "Recheck Supported Languages" to detect the general prompt will disappear, if the prompt does not disappear in fact ignore it is fine. WeI've asked official customer service.This feature does not affect the automatic translation, it is irrelevant, as long as you keep the default "Default" selected for all languages in the general settings. If you don't mind, you can use Google Translate API instead (only available on servers outside mainland China).
A user feedback that his website prompts Languages without formality problem ↓, still can be automatically translated, but the translation speed is very slow (the website needs a visitor to visit the corresponding multi-language page to trigger the translation). We have a client's website which also prompts this error for Japanese language, but it can also be translated automatically.
4- Website default language cannot be changed (fixed)
Before TranslatePress add a "preferred user language" function, will lead to "site language" follow "user language", can not be changed. Chinese sites do not have much impact, the English site a little impact.
User Language ↓
Causes the site language↓ to be unable to be changed
FOLLOW-UP: We contacted the official team to feedback this bug and they have fixed the issue in version 2.4.3.
5- Elementor edit page prompts 404 or keeps blinking
If automatic user language detection is enabled, thebesidesUsing the automatic jump ↓ in the figure below, and your language is not the same as the editor language, it will cause the Elementor editor page to automatically jump to the corresponding language version. However, the Elementor editor interface has only one language and cannot be adjusted, so it keeps jumping (shrinking) or prompting that it cannot be opened.
Just temporarily change to the popup below asking if you want to jump, and then just choose the default language of the site. Or just turn off the automatic user language detection.
2023.03.27: We've sent this bug back to the TranslatePress team and hope to fix it soon.
6- Translate button is not displayed
A customer bought the plug-in feedback top translation button ↓ does not display, the first time we encountered this problem, we are exceptionally excited. This plug-in function has been very stable, the first feeling is a plug-in conflict and so on.
Enter the customer background found at the same time installed Gtranslate translation plug-in, directly delete the Gtranslate button is displayed normally (disable can not be, have to delete). However, it is impossible to save the plug-in settings, prompting the following ↓ error.
It was found to be caused by Wordfence firewall interception, and the problem was solved by enabling learning mode, which allows you to save the TranslatePress plugin settings.
7- Incorrect page layout in translated languages
Different languages have different word lengths, for example, French words are longer than English words, so the interface layout may be wrong after switching from English to French.
The top ↑ is the English header, the bottom ↓ is the French header, and the navigation is too long to become 2 lines.
Solution: Delete as much content as you can to make the page more concise. If you can't delete it, you can change a shorter translation, for example, the English INQUIRY button on the right side of the blue button above is too long when translated into French, we can use Google Translate to translate INQUIRY into enquête, which greatly reduces the length.
Go to the manual translation screen of the website, change the corresponding French translation to enquête and tap Save.
And then Contact Us into Contact translated into French to shorten the length of the French page header ↓ display back to normal.
8- Modification of translations
Automatic translation is really full of errors, must check the translation of each page, at least check the company name, product name and so on there is no translation error. A customer has very high requirements for translation, checking every word in every language and summarizing them for us to modify. Let's share the experience of modifying translations.
Using the top button Enter the translation interface, sometimes the network is not good may be stuck, the top has been in a circle, you need to wait a few seconds before you can select the content translation. If you wait or not, try to close the page and reopen the translation interface.
SEO titles displayed in browser tabs on website pages If you can't find it, or if you need to change a lot of pages in bulk, you can use the database tool to search and replace the meta. If you can't find it, or if you need to change many pages in batch, you can use the database tool to search and replace the tool.Better Search ReplaceReplacement, fast and good.
Note: Replace the database content to backup the database first to avoid errors. When replacing, mainly do not replace the URL, login username and other important content contains text words, etc., otherwise it will damage the site.
Note: Only tables containing the beginning of _trp_ will hold the translation result data. check all tables containing the beginning of _trp_.
Remember to check the box "Run as dry run", the replacement does not take effect, just to check whether it can be replaced successfully and so on.
If the test can be replaced successfully, uncheck the "Run as dry run" in the following figure, and click "Run Search/Replace" to start replacing the content formally.
Successful replacement of the top will show the following content.
9- How to Display Language-Based Content Using TranslatePress Conditional Shortcodes
The Elementor widget Advanced Options has the option to display content based on language (below).
If the page content is not created by Elementor, you can use conditional shortcodes to control the content to be displayed only in certain languages. For example, the following text and images will only appear in the English version and will not be displayed in non-English versions such as Chinese.
Extension: If you want to change the page layout in some languages, you can add CSS and use the above two methods to set the CSS code to display only in some languages. For example, the Arabic page content defaults from right to left, if you want to change the content of some sections to left-aligned, you can add code to the Arabic page control.
10- Excluding certain content from being translated
Check the official methodthis article, very detailed. If some content has already been translated, such as say inquiry/form notification emails, you need to manually remove the translation by clicking on theView Specific MethodsThe
If you don't want some pages to be translated in multiple languages, just fill in the corresponding page URLs in "Settings" > "Exclude strings" > "Don't translate certain paths" and click Save. One line one URL, pay attention to the URL formatting.
If you want to exclude some content from being translated, enter the classname of the container (div/p/span or something like that) where the corresponding content is located and click "Add", then click "Save Changes".
17- List pages and such are not automatically translated
It is also possible to manually edit the code to add to the property data-no-translation To exclude being translated, clickView Details. You can also enter the URL path to exclude the entire page from being translated↓.
11- Cracked version prompts invalid serial number
If you are using a cracked version, the background will prompt the following content. All functions work normally and have no effect. If you want to remove these 2 annoying prompts, just add 2 pieces of code.Click for detailsThe
12- How to Translate WooCommerce Emails
Plugins such as Woocommerce have many email templates that automatically send emails when a customer registers and makes a purchase. For multi-language e-commerce sites, you need to translate the email templates. ClickView the official tutorialThe
13- Non-login multilingual SEO Title and SEO Description are shown as original text.
A user reported that after manually translating the SEO Title and SEO Description of a multilingual page, the translated SEO Title and SEO Description are displayed normally on the multilingual page in logged-in state, but the multilingual SEO Title and SEO Description are displayed in the original language in non-logged-in state (Guest Mode) (Untranslated state). However, the multilingual SEO Title and SEO Description are displayed in the original language (untranslated) in non-login (guest mode).
In the end it turned out to be that he used the Asset CleanUp plugin to disable the TranslatePress code for the non-logged-in state, which led to abnormal functionality, so just un-disable it.
Tidbit: He is using SiteGround server, at first disabling other plugins to clear cache didn't bring it back to normal, and it took several tries to get it to work. If you are using SG server, you'd better go to SG server admin panel to manually clear all caches or temporarily disable caches when debugging.
14- How to use subdomains in multilingual versions
This translation plugin multilingual cannot be used in subdomain form (ru.example.com), only in subdirectory form (example.com/ru). The subdirectory form of multilingual can benefit from the weight of the root domain, better SEO than a subdomain, and is easy to manage and fast. To use sub-domain form you need to change to SMPL and other multilingual plug-ins, but SMPL and other plug-ins are too bloated, slow and not good.
15- Website slows down after using a plugin
There was a feedback from a user that after using TranslatePress, the site slowed down. I was shocked when I saw 30 languages. Usually, you can choose 3-5 languages, and any more than that won't be a waste of resources with the number of visitors.
In fact, the plugin itself will not be stuck, we have not found this problem in the depth of use in a number of sites. More languages will not lead to card, according to theory, are pre-translated and saved in the database, access to directly retrieve. Later on, we realized that it's a cache thing. Each language will generate a separate cache, especially after updating the content of the site, to regenerate the cache of 31 languages, can not be stuck.
Pre-cache or re-generate cache is very eat server resources, the more languages you need to generate cache and pre-cache the more pages, the more the server is stuck, for the low configuration server is not affordable.Fastest Cache pre-cache the number of pages at a time up to 12, Wp Rocket can go up to more than 40, depending on the settings and server performance.
The way to solve the speed card is to minimize the number of multi-language, it is recommended to keep 3-5 kinds, if possible, pre-cache settings do not pre-cache some unimportant pages. At the same time, you should also use better performance caching plug-ins, such asWp Rocket, you can accurately generate and control caches and pre-caches.
16- Unable to click the Save Changes button on the Multi-language Add screen.
In some websites, the "Save Changes" button in the image below is not clickable, and a look at the source code reveals that there is a transparent panel covering the button.It's a conflict between your website plugin or browser pluginIf you can't, disable all other plug-ins except the translation plug-in and try again.
17- List pages and such are not automatically translated
A user feedback that the home page can be automatically translated, but the list page can not be automatically translated, using the browser to visit the front-end of the corresponding language page to trigger the translation does not work. The reason ispseudostaticThere was a problem with the setup, his URL had an index.php suffix. Adjusted pseudo-static and back to normal.
Shared hosting or managed VPS hosts will have pseudo-static pre-set, no need to deal with it. Pagoda panel can also add pseudo-static with one click, and everything works fine. Usually it's the player's handwriting pseudo-static that causes this problem.
18- trp-ajax.php, skip_machine_translation errors
Administrator front-end access to the site prompted the following picture, WordFence firewall also prompted to access the corresponding URL was determined to be an XSS attack, was intercepted, Pagoda firewall monitoring reports can also be seen in the corresponding interception records. In fact, it is misreported that TranslatePress uses trp-ajax.php plugin to execute database link which is misjudged as XSS attack.View DetailsThe
There are 2 solutions:
1- In WordFence "real-time traffic" board to find the corresponding blocking records in the following figure, click "Add Param to Firewall Allowlist" to add a whitelist, if the server and the CDN firewall have If the server and CDN firewall have blocked the traffic, you should also add the whitelist;
2- InstallationThe plugin in this postThis is the easiest way to change the way TranslatePress operates, and it's the easiest way to do it for beginner users.