Multilingual Search
TranslatePress supports multilingual search out of the box.
For your post to appear in the search it must first be visited in a language other than the default one, for the strings to be indexed. The post title and everything generated inside the post content are indexed. This includes page builder generated content for example.
After that just input the search terms in the default WordPress search box and the results will appear normally on your search results page.
You can also search for Woocommerce products using the Product Search Widget in the Woocommerce plugin.
Other Woocommerce search methods can be compatible.
Upgrade to version 2.0.5 or newer
Starting with version 2.0.5 we have changed the way individual TranslatePress add-ons are used by simplifying the process and re-packaging all pro add-ons into 3 different premium versions: TranslatePress Personal, Business and Developer.
If you』re upgrading from a version older than 2.0.5 here are the steps you need to take:
Upgrade instructions for TranslatePress older than version 2.0.5
1. Update the main plugin to the latest version
You can upgrade to the latest free version directly from your WordPress site by going into:
WordPress Admin Dashboard → Plugins → Installed Plugins and clicking on the: 「Update now」 button.
Or you can download the latest free version directly from here:
Download the latest free version now
2. Download, install and activate the premium TranslatePress Personal/Business or Developer version
Access your TranslatePress account and download the premium TranslatePress – Personal/Business/Developer version you purchased.
Then install and activate the premium version of the plugin. After you download the plugin, install it from your WordPress admin Plugins → Add New → Upload and upload your .zip file, and then just hit the Install Now button.
3. Deactivate and remove old individual TranslatePress add-ons (these won』t get any new updates)
After the premium version was activated, you can delete all the old TranslatePress related add-ons as they won』t get any new updates moving forward. All of them are now bundled in the premium version of the plugin.
4. Navigate to the Addons tab and activate all the needed functionality
In order to (re)activate the functionality that was added by the old addons, now you can simply navigate to Settings → TranslatePress → Addons tab. From here you have the option to activate/deactivate each addon functionality.
Once you activate a certain add-on, all your old (existing) settings will be ported over.
Installation
TranslatePress allows you to translate your website content page by page, directly from the front-end.
It also supports automatic translation via Google Translate or DeepL.
Installing TranslatePress
TranslatePress installs and is activated just like any other WordPress plugin.
You can watch the following video for a quick installation tutorial or continue reading for an in-depth approach:
<span data-mce-type="bookmark" style="display: inline-block; width: 0px; overflow: hidden; line-height: 0;" class="mce_SELRES_start"></span><span data-mce-type="bookmark" style="display: inline-block; width: 0px; overflow: hidden; line-height: 0;" class="mce_SELRES_start"></span><span data-mce-type="bookmark" style="display: inline-block; width: 0px; overflow: hidden; line-height: 0;" class="mce_SELRES_start"></span>
Download the plugin zip file
After purchasing a license, you』ll receive an email containing links to your purchased downloads and also the information to access your account.
By logging into your TranslatePress Account you will be able to download the main plugin, download the premium version, upgrade to another version, see your serial number, renew your license if it』s expired and also see your purchase history with us.
After you download the plugin:
Unzip the archive and upload the plugin folder under the /wp-content/plugins directory.
Or install it from your WordPress admin Plugins → Add New → Upload and upload your .zip file and then just hit Install Now button.
Activate TranslatePress
After the installation completes, just press Activate Plugin and the plugin will be ready for use.
Where is TranslatePress located in the navigation menu?
After the installation and activation, you can find the TranslatePress options page under Settings -> TranslatePress.
Activate your license
To activate your license, go to Settings → TranslatePress and then to the License tab.
The License tab will become available only after installing one of the paid versions.
Here, you need to enter the serial number you received with your purchase and press Activate License.
You need to press this button in order to activate the license. If the license is valid and not expired, the activation will work, else, it will fail to display a notice:
Image translation
With TranslatePress you can show different images for each language of your website.
To do this just click the button corresponding to the image you want to translate or select the image by name from the dropdown of strings under Images option group.
In the left sidebar you can use the Add Media button to upload a new image or select one from the Media library. You can also just type the url of the translated equivalent of the original image in the text box.
Beside the image source, you can also translate all the existent associated meta information such as the alt attribute and title attribute. If the image is inside an anchor pointing to its larger version of the image for example, you will be able to translate the href attribute of the anchor.
All the translatable meta information associated with the image will be shown together with the image source in the sidebar.
Note: To translate the alt attribute you will need the SEO Add-on which is only available in the paid versions of the plugin.
Image slider translation
To translate an image slider or an image carousel, you simply need to hover over the images displayed and click for each image you want to replace when viewing in a different language.
Translating the alt attribute and all the other meta information can be done from the left sidebar of the Translation Editor.
Note: To translate the alt attribute you will need the SEO Add-on which is only available in the paid versions of the plugin.
Related: How to Translate Images in WordPress [Complete Guide]
Frequently asked questions
Also checkout the Troubleshooting page.
Translate only certain pages
TranslatePress makes it really easy to translate only certain pages or exclude content from translation.
The Do not translate certain paths feature can be used to:
Exclude Paths From Translation – enables translation sitewide but lets you manually exclude entire posts, pages, cpts or products from translation.
Translate Only Certain Paths – disables translation sitewide but lets you manually enable translation for certain content.
This feature can be accessed by going to: Settings -> TranslatePress -> Advanced tab -> Exclude Strings -> Do not translate certain paths
Exclude Paths from Translation
With the URL paths feature, you can use the Exclude Paths From Translation option to exclude certain content from translation by entering its URL path. When adding a URL path, you have three options to target content:
Specific URL path – you can enter the full URL path to only exclude just that specific piece of content.
Wildcard – you can use a wildcard (*) to target multiple pieces of content that match. For example, entering /blog/* would target every piece of content that has /blog/ as its root, including /blog/post-1/, /blog/post-2/, etc.
Home tag – you can enter {{home}} to target your homepage.
TranslatePress will disable translation and hide the language switcher for any content that matches the URL paths that you enter.
Translate Only Certain Pages (Paths)
In addition to excluding content by its URL path, TranslatePress lets you only enable translation for specific content by its URL path using the Translation Only Certain Paths option. This is a good option if you only want to include translation on a few pages on your site and want to disable translation everywhere else.
You can use all the same URL path options that you get for excluding content. The only difference is that you』ll select Translate Only Certain Paths when adding the URL paths:
TranslatePress will enable translation and show the language switcher only for the content that matches the URL paths that you enter.
Show opposite language in language switcher
How to Show Opposite Language in Language Switcher
Showing the opposite language in your language switcher comes in really handy in bilingual websites. You want to set it up so that you see the other language name or flag in the menu, not the current language.
There are two ways to achieve this, which we』ll detail below:
1. In your Menu Language Switcher
Let』s say you want to show just the opposite flag(s) in your menu.
This is possible with a bit of CSS.
go to Appearance -> Menus -> Language Switcher
select Opposite Language
Note:This option only works when there are exactly two languages, the default one and a translation one.
2. In your Shortcode Language Switcher and Floating Language Switcher
Another place where you might want to display the opposite flag(s) could be in the shortcode language switcher and the floting language switcher. You can achieve this by enabling the 「Show opposite language in the language switcher」 option from the Advanced tab. You have to scroll all the way down as this option is above the Custom language section.
Note: This option only works when there are exactly two languages, the default one and a translation one.
Replace Default Flags
If you』re looking to replace the default flags for certain languages of your multilingual site you can use one of the two options below:
1. Replace Default Flags — directly from the Advanced tab
You can add a new flag for an existing language directly from TranslatePress Settings –> Advanced tab –> Custom Language section.
From here you add all the information about an existing language, or just use another image for the flag.
Once you』ve uploaded and selected the new flag image make sure to click 「Save Changes」.
You can read more about Custom Languages here.
2. Alternative Code Based Method
Note: if you are looking to replace the default flags in order to add a custom language please consult the documentation here.
You can replace the default flags in TranslatePress by using a bit of coding:
Create an empty plugin like this:
https://gist.github.com/sareiodata/76f701e01db6685829dbSince this plugin will contain the new flags, you』ll have to include the plugin file inside a folder like /tp_custom_flags as well as to create /tp_custom_flags/flags subfolder where the new ones will be found.
Add the following code to the end of it:
/**
* Change flags folder path for certain languages.
*
* Add the language codes you wish to replace in the list below.
* Make sure you place your desired flags in a folder called "flags" next to this file.
* Make sure the file names for the flags are identical with the ones in the original folder located at 'plugins/translatepress/assets/images/flags/'.
* If you wish to change the file names, use filter trp_flag_file_name .
*
*/
add_filter( 'trp_flags_path', 'trpc_flags_path', 10, 2 );
function trpc_flags_path( $original_flags_path, $language_code ){
// only change the folder path for the following languages:
$languages_with_custom_flags = array( 'en_US', 'es_ES' );
if ( in_array( $language_code, $languages_with_custom_flags ) ) {
return plugin_dir_url( __FILE__ ) . '/flags/' ;
}else{
return $original_flags_path;
}
}
Modify the code by editing the language codes list with the languages you wish to replace. In the example we are adding custom flags for languages en_US and es_ES. The rest of the flags will not change.
Make sure you place your desired flags in a folder called 「flags」 next to this file. Put both the folder and this file into another folder.
Make sure the file names for the new flags are identical with the ones in the original folder located at 『plugins/translatepress/assets/images/flags/』.
Install this plugin via FTP (copy it inside wp-content/plugins) or create a zip archive with it and install it via the WordPress plugin upload functionality
Remove TranslatePress Hooks
remove_hook( 'init', 'create_gettext_translated_global' );
$trp_loader->remove_hook( 'shutdown', 'machine_translate_gettext' );
}
view raw
remove_tp_hooks.php
hosted with ❤ by GitHub