Shopify - How to exclude from translation all pages except specific one(s)?
In this article, you'll find how to exclude every page from translation except specific ones.
Go to your Shopify dashboard > Apps > Weglot Translate > Other options section > Exclude paths.
There, you'll be able to add the pages you would like to exclude.
Actually, there's a way to say "exclude everything except..".
This is possible with regular expressions (RegEx).
Little reminder: the Exclude URL section is working with relative URLs. For example, if your page is www.mywebsite.com/page/, then /page/ is the relative URL.
Once you've filled the field " Exclude paths" with a regular expression, click on Add and don't forget to Save after that:
Tips for the Exclude URL section with regular expressions (RegEx)
- Exclude everything except a specific page using its relative URL: ^(?!/mypage/$).*
- Exclude everything except the landing page: ^(?!\/$).*
- Exclude everything except a few specific pages: ^(?!/$|/shop/$|/categorie-produit/$|/produit/$).*
- Exclude everything except every page that begin by /product/... ^(?!/product/).* (Meaning, without the "$")