> 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/wordpress/use-cases/exclude-a-custom-post-type.md).

# Exclude a Custom Post Type

To avoid adding URLs to the Weglot exclusion list, you can disable the translation of a given post type directly with our hooks. In the example below we exclude the built-in `page` type — replace `'page'` with your own Custom Post Type slug.

```php
<?php

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

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;
}
```
