Hi @ntokozodev,
Great question. The easiest way to disable ads on particular pages of your site is to use the AdSense Auto ads settings. You’ll find more details on this below:
https://support.google.com/adsense/answer/9262311?hl=en&ref_topic=9261304
If you’re looking to exclude ads for a particular post type, rather than on particular pages, you can use the same Auto ads settings above if all your URLs from this post type follow a particular permalink structure.
Alternatively you can use the googlesitekit_adsense_tag_blocked
filter to programmatically ensure the Auto ads snippet doesn’t placed via Site Kit doesn’t appear on any page or post type. Something similar to the below can be used, for a custom post type called my_custom_post_type
:
add_filter( 'googlesitekit_adsense_tag_blocked', restrict_adsense_snippet);
function restrict_adsense_snippet( $original ){
if ( is_post_type_archive( 'my_custom_post_type' ) )
return true;
}
Let me know if you have any questions with the above, or if you need further assistance with the filter.