Make (custom) post type accessible only by custom query July 23, 2022 by Tarik Billa Try using 'publicly_queryable' => false when registering your CPT.