Using a custom post type for an RSS feed only

You could try forcing a 404 using this method: /** * Force 404 on all “alerts” custom post type pages except for the feed * * @see https://wordpress.stackexchange.com/a/162303/26350 */ add_action( ‘template_redirect’, function() { if( ‘alerts’ === get_post_type() && ! is_feed() ) { $GLOBALS[‘wp_query’]->set_404(); status_header( 404 ); nocache_headers(); } } ); with the following setup: $alert_args … Read more