# Can not make translate exclusions

**URL:** <https://community.elfsight.com/t/can-not-make-translate-exclusions/96633>\
**Category:** General Questions\
**Tags:** website-translator\
**Created:** [January 24, 2025, 10:31am UTC](https://community.elfsight.com/t/can-not-make-translate-exclusions/96633 "2025-01-24T10:31:21Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![user20292](https://avatars.discourse-cdn.com/v4/letter/u/b487fb/32.png) [@user20292](https://community.elfsight.com/u/user20292)\
**Post date:** [January 24, 2025, 10:31am UTC](https://community.elfsight.com/t/can-not-make-translate-exclusions/96633/1 "2025-01-24T10:31:21Z")

</div>

Hi  
I tried to use the Elfsight Translation widget and exclude some words from being translated.  
My website: premiumportraits.ai  
I would like to exclude “HEADSHOTS” for example - in the navigation or somewhere else on the page. (The translation in German is “Kopfschuss” which has quite a different meaning - except I offer this service in the darknet ha ha)  
Unfortunately I didn’t succeed even with trying several things. Can you help me?  
Thank you very much in advance.  
best regards, Phil

---

<div class="post-metadata">

**Author:** ![user20292](https://avatars.discourse-cdn.com/v4/letter/u/b487fb/32.png) [@user20292](https://community.elfsight.com/u/user20292)\
**Post date:** [January 24, 2025, 10:33am UTC](https://community.elfsight.com/t/can-not-make-translate-exclusions/96633/2 "2025-01-24T10:33:46Z")

</div>

ignore-GENERATE HEADSHOT  
ignore-create headshot  
KI-KOPFSCHÜSSE  
ignore-GENERATE HEADSHOTS  
headshots  
Headshot  
HEADSHOTS  
ignore-headshot  
ignore - headshot

Some of the variants I tried

---

<div class="post-metadata">

**Author:** ![Max](https://sea2.discourse-cdn.com/flex020/user_avatar/community.elfsight.com/max/32/710_2.png) [@Max](https://community.elfsight.com/u/Max)\
**Post date:** [January 24, 2025, 12:14pm UTC](https://community.elfsight.com/t/can-not-make-translate-exclusions/96633/4 "2025-01-24T12:14:32Z")

</div>

Hi @user20292 👋

The correct class for this phrase is .ww\_menu\_link\_text. However, 40 more elements on your website have the same class.

To apply the exclusion to the AI Headshot only, we’ve added this script to the Custom JS section on the Settings tab of your widget’s settings:

```auto

const targetSelector = '.ww_menu_link_text';

const waitForElement = (selector, root = document) =>
	new Promise((res) => {
		let i = 0;

		const check = () => {
			const component = root.querySelectorAll(selector);

			if (component) {
				res(component);
			} else if (i !== 150) {
				setTimeout(check, 100);
				i++;
			}
		};

		check();
	});

waitForElement(targetSelector).then((targets) => {
	targets.forEach((target) => {
		if (target.textContent === 'AI HEADSHOT') {
			target.classList.add('exclude-translation');
		}
	});
});

```

  

This script assigns the unique class .to ww\_menu\_link\_text and only “AI Headshot” is excluded from the translation:

 ![image](https://us1.discourse-cdn.com/flex020/uploads/elfsight/original/3X/1/9/1999b8bdb317df0815c99396ed9ae116f2acf1a2.jpeg)

  

Please check your website and let me know if you like the result 🙂

---

<div class="post-metadata">

**Author:** ![user20292](https://avatars.discourse-cdn.com/v4/letter/u/b487fb/32.png) [@user20292](https://community.elfsight.com/u/user20292)\
**Post date:** [January 24, 2025, 12:30pm UTC](https://community.elfsight.com/t/can-not-make-translate-exclusions/96633/5 "2025-01-24T12:30:20Z")

</div>

Hi Max

Thank you very much for your fast reply and help. Amazing!

That is already great.

If I want to add some more words or translations - can I do that myself and if so, how?

Is is not possible to do so in the “classic” exception part?

Only possible through JS section?

I saw for example a text that is not translated properly and would like to change that.

VORTEILE GEGENÜBER EINEM  
 ECHTES FOTOSHOOTING

This should be: VORTEILE GEGENÜBER EINEM **ECHTEN** FOTOSHOOTING

This is just one example. Is there any technique or anything I can adjust the correct version?

Thank you so much!

have a wonderful day

best regards

Phil

---

<div class="post-metadata">

**Author:** ![Max](https://sea2.discourse-cdn.com/flex020/user_avatar/community.elfsight.com/max/32/710_2.png) [@Max](https://community.elfsight.com/u/Max)\
**Post date:** [January 24, 2025, 12:54pm UTC](https://community.elfsight.com/t/can-not-make-translate-exclusions/96633/6 "2025-01-24T12:54:14Z")

</div>

Unfortunately, it’s impossible to adjust translations or add more words. I am really sorry!

We already have a request for this feature on the Wishlist. Feel free to upvote it here - [Custom translation](https://community.elfsight.com/t/custom-translation/60951)

---

<div class="post-metadata">

**Author:** ![user20292](https://avatars.discourse-cdn.com/v4/letter/u/b487fb/32.png) [@user20292](https://community.elfsight.com/u/user20292)\
**Post date:** [January 24, 2025, 1:16pm UTC](https://community.elfsight.com/t/can-not-make-translate-exclusions/96633/7 "2025-01-24T13:16:34Z")

</div>

Thank you so much!  
But the normal “Translation Exclusion” doesn’t work? Can I not write: exclude-WORD

---

<div class="post-metadata">

**Author:** ![Max](https://sea2.discourse-cdn.com/flex020/user_avatar/community.elfsight.com/max/32/710_2.png) [@Max](https://community.elfsight.com/u/Max)\
**Post date:** [January 24, 2025, 1:32pm UTC](https://community.elfsight.com/t/can-not-make-translate-exclusions/96633/8 "2025-01-24T13:32:35Z")

</div>

Translation Exclusions section works great.

The thing is that “AI Headshot” has the same class as 40 other elements on your website. If we just added this class to the Translation Exclusions, other 40 elements with this class wouldn’t be translated either.

To apply the exclusion to “AI Headshot”, we’ve added the script to the Custom JS field. Thus, if the word/phrase has a unique class, you should add it right to the Translation Exclusions.

To find the needed class, right-click the word/phrase you’d like to exclude, choose Inspect and you’ll see the class name:

 ![image](https://us1.discourse-cdn.com/flex020/uploads/elfsight/original/3X/0/c/0c333b420b4bc72955f222feeccdd186491cbaf0.jpeg)

---

<div class="post-metadata">

**Author:** ![user20292](https://avatars.discourse-cdn.com/v4/letter/u/b487fb/32.png) [@user20292](https://community.elfsight.com/u/user20292)\
**Post date:** [January 24, 2025, 1:37pm UTC](https://community.elfsight.com/t/can-not-make-translate-exclusions/96633/9 "2025-01-24T13:37:30Z")

</div>

Thank you very much for your help. Have a wonderful day

---

<div class="post-metadata">

**Author:** ![Max](https://sea2.discourse-cdn.com/flex020/user_avatar/community.elfsight.com/max/32/710_2.png) [@Max](https://community.elfsight.com/u/Max)\
**Post date:** [January 24, 2025, 1:38pm UTC](https://community.elfsight.com/t/can-not-make-translate-exclusions/96633/10 "2025-01-24T13:38:02Z")

</div>

No problem!

Have a great day too 😉
