> For the complete documentation index, see [llms.txt](https://developers.weglot.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developers.weglot.com/cms/wordpress/helpers-functions-1/weglot_noindex_urls.md).

# weglot\_noindex\_urls

This filter allows you to keep some translated URLs out of the search engines index.

*Available since Weglot 6.3.*

Some pages are worth translating for your visitors but not worth indexing — a cart, a thank-you page, a landing page that only exists for one market. This filter marks those URLs as `noindex` in the languages of your choice, without excluding them from translation.

```php
add_filter( 'weglot_noindex_urls', function ( $rules ) {
    $rules[] = array(
        'value'     => '/pricing',
        'type'      => 'IS_EXACTLY',
        'languages' => array( 'fr', 'es' ),
    );

    return $rules;
} );
```

### Rule format

Each rule is an array with the following keys.

| Key         | Required | Default                    | Description                                                                                                                                                         |
| ----------- | -------- | -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `value`     | yes      | —                          | The **original** path to match, for example `/pricing`. An absolute URL is accepted and reduced to its path.                                                        |
| `type`      | no       | `CONTAIN`                  | How `value` is matched. One of `CONTAIN`, `NOT_CONTAIN`, `START_WITH`, `NOT_START_WITH`, `END_WITH`, `NOT_END_WITH`, `IS_EXACTLY`, `NOT_IS_EXACTLY`, `MATCH_REGEX`. |
| `languages` | no       | every destination language | Internal language codes the rule applies to. Omit it, or leave it empty, to target every translated version of the page.                                            |

A rule without a `value`, or one whose `languages` contain no code your project knows, is ignored.

The `type` values are plain strings, the same ones used by [weglot\_exclude\_urls](https://developers.weglot.com/cms/wordpress/helpers-functions-1/weglot_exclude_urls.md). They match the constants of Weglot's `RegexEnum` class, but you do not need to import or reference that class — write the string directly.

### Always use the original path

Rules are matched against the **original** path, never the translated one. If your Spanish version of `/pricing` is served at `/es/precios`, the rule is still written `/pricing`:

```php
add_filter( 'weglot_noindex_urls', function ( $rules ) {
    $rules[] = array( 'value' => '/pricing' );

    return $rules;
} );
```

This keeps your rules valid even if you later change a translated slug.

### The original language is never affected

Whatever the rule says, Weglot never adds `noindex` to your original language. The SEO of your source pages stays entirely under your control — use your SEO plugin for that.

### What Weglot outputs

On a page matched by a rule, in a targeted language, Weglot prints in the `<head>`:

```html
<meta name="robots" content="noindex, follow"/>
```

`follow` is intentional: the page leaves the index, but search engines keep following its internal links so the rest of your translated site is still discovered.

The tag is printed late, after the one your SEO plugin outputs. You do not need to disable Yoast, Rank Math or any other plugin: when several `robots` meta tags are present, search engines combine them and apply the most restrictive directives.

Weglot also removes the matching language from the `hreflang` cluster of that page, in every language. A `hreflang` pointing at a `noindex` page is a contradictory signal that search engines discard, and which can invalidate the whole cluster.

### Excluding versus not indexing

|                           | [weglot\_exclude\_urls](https://developers.weglot.com/cms/wordpress/helpers-functions-1/weglot_exclude_urls.md) | `weglot_noindex_urls` |
| ------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------- |
| Page is translated        | no                                                                                                              | yes                   |
| Reachable by visitors     | not in that language                                                                                            | yes                   |
| Appears in search results | no                                                                                                              | no                    |

Use `weglot_exclude_urls` when a page should not exist in a language at all, and `weglot_noindex_urls` when it should exist for your visitors but stay out of search results.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://developers.weglot.com/cms/wordpress/helpers-functions-1/weglot_noindex_urls.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
