If you dive into how this works, you end up at set_props
. At the bottom of that function you see that setting rewrite' => array('feeds' => false)
will be interpreted as ‘no rewriting’, meaning the default will be used. Also, if you have not set the has_archive
argument WP will not know what to fill the feed with. This is what leads to your 404’s.
That said, what you need is a function that intercepts queries for \feed\
before they lead to a 404. After all, you can’t prevent people typing that url in their browser window, even if there would be a method to stop WP from generating it. So I’d do a check like this:
add_action ('template_redirect','wpse402292_redirect_feed');
function wpse402292_redirect_feed() {
if (is_feed (array ('post','your-custom-post-type-name')))
wp_redirect( home_url( '' ) ); // or somewhere else
}
Related Posts:
- Add Custom Fields to Custom Post Type RSS
- How to Make a Separate RSS Feed for Each Custom Post Type
- Rewrite custom post type rss feed links
- How can I generate a RSS feed based on a custom WP_Query?
- feed links for custom post type pages
- Custom post types – RSS lastBuildDate issue
- How to remove CPT comment feed from head?
- How to change the quantity of feeds in custom post type?
- Add Taxonomy Values Within a Custom Post Type RSS Feed
- Adding posts of custom type into the main feed
- register_post_type – rewrite / feeds, what’s it for?
- How can we disable a custom post type archive page but enable its feed?
- Disable feeds for specific custom post types
- How to make custom post type feed title = taxonomies?
- Include only recents custom posts in WP rss feed
- Custom taxonomy in custom post RSS feed
- How to use has_archive but disable feed per post type?
- Display custom fields from custom posts in RSS feed
- What is best way to prevent access to Custom Post Types unless authenticated when the post type has an archive and is publicly queryable?
- Is it possible to have a custom post type with feed but without the archive?
- How can I show 1 featured post in a styled element, and the next few below differently styled
- 404 in custom post type feed with mistake permalink
- Custom rewrite to fetch feed data
- Creating separate feeds for custom post types
- How to fetch custom post types with its full data on wordpress?
- wp-includes does not contain a feed template
- wp3 custom post types rss
- Disable permalinks, but allow RSS feeds
- WordPress feed only shows first page of category
- Get link for feed of specific post type AND taxonomy
- Changing the RSS feed titles not working
- display posts, pages and custom post types from another wordpress site
- How do test if a post is a custom post type?
- Where to put my code: plugin or functions.php?
- What does this PHP function code mean? [closed]
- Remove slug from custom post type post URLs
- How to disable the single view for a custom post type?
- Custom post types, taxonomies, and permalinks
- Query all posts where a meta key does not exist
- How to create a permalink structure with custom taxonomies and custom post types like base-name/parent-tax/child-tax/custom-post-type-name
- How to get all taxonomies of a post type?
- How to sort the admin area of a WordPress custom post type by a custom field
- How to create a custom search for custom post type?
- Deregister custom post types
- Can I assign a template to a custom post type?
- Permalinks: custom post type -> custom taxonomy -> post
- Should I use custom post types or a custom database tables for plugin development?
- Enable revisions for custom post type
- Extending the search context in the admin list post screen
- How do I query a custom post type with a custom taxonomy?
- Adding a Custom Post Type into the menu screen
- Pagination not working with custom loop
- How to Add Tags to Custom Post Type?
- How come Featured Image isn’t showing up in my Custom Post Type?
- Custom Post Type URL Rewriting?
- Add category base to url in custom post type/taxonomy
- Include custom taxonomy term in search
- Is It Possible To Add Custom Post Type Menu As Another Custom Post Type Sub Menu
- Adding ‘menu order’ column to custom post type admin screen
- Capabilities and Custom Post Types
- Can the Next/Prev Post links be ordered by menu order or by a meta key?
- what is the correct way to compare dates in a WP query_posts meta_query
- Use register_post_type() to modify an existing post type
- Custom Taxonomy specific to a Custom Post type
- Renaming Custom Post Types and Taxonomies
- List all posts in custom post type by taxonomy
- Redeclare/Change Slug of a Plugin’s Custom Post Type
- Allow member to have access to custom post type only. Permission to only edit their own posts
- Mixing custom post type and taxonomy rewrite structures?
- Advanced search form with filters for custom taxonomies and custom fields
- Highlighting wp_nav_menu() Ancestor Class w/o Children in Nav Structure?
- Resolve a custom post type name vs. page permalink conflict (same slug)
- Get custom post_type’s archive URL
- Enable Gutenberg on custom post type
- Is there a way to get N number of WYSIWYG editors in a custom post type?
- Can multiple custom post types share a custom taxonomy?
- How to Add Custom Fields to a Custom Post Type?
- Hook for post and page load
- How to enqueue scripts on custom post add/edit pages?
- How to display value of custom fields in page
- Where are wordpress custom types stored?
- Using save_post to replace the post’s title
- Custom Post Type pages are “not found”
- Possible to hide Custom Post Type UI/Menu from specific User Roles?
- How do I safely change the name of a custom post type?
- Custom post type single page returns 404 error
- Change “Enter Title Here” help text on a custom post type
- Hide content box with Custom Post Type?
- Change the text on the Publish button
- WP REST API fetch posts from post type
- Remove taxonomy slug from a custom hierarchical taxonomy permalink
- Adding categories to custom post type in permalink
- Load a script just to custom post type in admin
- Display all posts in a custom post type, grouped by a custom taxonomy
- How do you use a CPT as the default home page?
- get_terms by custom post type
- single-{$post_type}-{slug}.php for custom post types
- How do you use orderby with meta_query in WordPress 3.1?
- Custom post type single-{custom}.php not working
- How to get custom post type post id from slug?