In this article, you'll learn how to exclude every page from the translation except for specific ones.
How to exclude pages from the translation?
To exclude a URL, navigate to your Weglot Dashboard > Use the menu at the top left to select your workspace > Select your project, and go to the "Exclusions" section.

There, you'll normally be able to add the pages you would like to exclude by clicking on “Add an exclusion rule”.
Then, you will find several ways to exclude all pages except specific ones:
By directly selecting what the URL shouldn't contain

For this, you can click on "Add Rule" and select one of these options:
- "Is not exactly": This will exclude all the URLs with paths other than the one you added.
- "Does not start with": This will exclude all the URLs that don't start with the path you add.
- "Does not end with": This will exclude all the URLs that don't end with the path you add.
- "Does not contain": This will exclude all the URLs that don't contain the path you add.
Tips: The Exclude URL section works with relative URLs. For example, if your page is www.mywebsite.com/mypage/, then /mypage/ is the relative URL.
For example, if you select "Is not exactly" and add the path "/my-page", this will exclude all URLs on your website, except "/my-page".
By using a regex rule
For this, you can click on "Add Rule" and select "Matches regex"

There's a way to say "exclude everything except..". This is possible with regular expressions (RegEx).
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 everything that begins with /product/... ^(?!\/product\/).* (Meaning, without the "$")
