# Excluding a Link but keep text translated

If you have an HTML anchor tag like:

```html
<a href="http://weglot.com" id="my-link">this is my link</a>
```

When this content is translated to French, Weglot will produce:

```html
<a href="http://weglot.com/fr/" id="my-link">c'est mon lien</a>
```

In this case:

* The **text content** `"this is my link"` is translated to `"c'est mon lien"`.
* The **URL** in the `href` attribute is also automatically adjusted to include the language code (e.g., `/fr/`).

If your link is **excluded** from translation, the result would be:

```html
<a href="http://weglot.com/fr/" id="my-link">this is my link</a>
```

Here, Weglot will still adjust the link to include the language code, but the **text content** will not be translated.

#### Keeping the Link Untranslated While Translating the Text

If you want to **keep the link unchanged** while still translating the text content, you can add the `wg-excluded-link` attribute to your tag:

```html
<a href="http://weglot.com" id="my-link" wg-excluded-link>this is my link</a>
```

With this attribute, the translation result will be:

```html
<a href="http://weglot.com" id="my-link" wg-excluded-link>ceci est mon lien</a>
```

Here, the text `"this is my link"` is translated to `"ceci est mon lien"`, but the `href` remains the same without adding a language code.

#### Purpose of `wg-excluded-link`

The purpose of the `wg-excluded-link` attribute is to allow users to translate the text label of a link while keeping the actual link URL unchanged. This is useful when you want to preserve specific URLs but still provide localized content for users.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://developers.weglot.com/wordpress/use-cases/excluding-a-link-but-keep-text-translated.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
