# Exclude a Custom Post Type

To avoid adding URLs to the Weglot exclusion list, you can disable the translation of a Custom Post Type (example: "**page**") directly with our hooks.

```php
<?php

add_filter('weglot_is_eligible_url', 'not_authorize_translation');
function not_authorize_translation(){
	if (get_post_type( weglot_get_postid_from_url() ) === 'page') {
    	return false;
	}

    return true;
}

add_filter('weglot_active_translation_before_process', 'check_page_translation');
function check_page_translation()
{
    if (get_post_type(weglot_get_postid_from_url()) === 'page' && weglot_get_current_language() !== weglot_get_original_language() ) {
		wp_redirect( weglot_get_request_url_service()->get_full_url() );
		exit;
    }

    return true;
}
```


---

# 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/exclude-a-custom-post-type.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.
