Shopify - Edition - How to exclude URLs/blocks/words from translation ?
In this article, you'll find how to exclude a specific block or paragraph from being translated in your Shopify website.
1. Exclude URLs
Using Weglot, you can exclude some pages from the translation. These pages won't be translated at all and the button won't be displayed, then.
To exclude an URl, please visit:
Shopify Dashboard > Weglot > Exclude Paths section.
Only add the relative URL of the page that you want to exclude.
For example, if your page is www.mywebsite.com/page1/, then only add its relative URL: /page1/
2. Exclude blocks
If you want to exclude a specific part of your website like the header for example, go to your Shopify admin > Weglot plugin > Exclude block section. There, you can paste the right CSS selector of the block.
You can find the CSS selector by right clicking on the block > Inspect Element.
In this example, you have the choice to exclude either the ID (menu-menu-1) or the CLASS (nav or navbar-nav). No matter the name of the selector, if it's and ID, you must add a sharp "#" before and if it's a CLASS, you must add a dot "." before.
Then, the navigation bar won't be translated whatever the language is.
Note that Weglot does not automatically remove the translations of the exclude contents. However you can manually remove these old contents from your Weglot Dashboard > Translation list.
3. Translations options
Go to your Weglot account > Translations Tools:
a. Translation Exceptions:
In this section you can indicate if you want a word/expression to be never translated or always translated in a custom way. The rules will be applied on all new translations but won't change the existing translations.
b. Search and Replace rules:
In this section you can search for a word in all translations and replace it. It is useful if a name has been mistranslated and you want to change it everywhere