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, 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 the translation and show the language switcher only for the content that matches the URL paths that you enter.