The register_post_type_args
filter (available from WordPress v4.4 on) will allow post type registration arguments to be changed:
function wpse206329_custom_post_type_args( $args, $post_type ) {
if ( $post_type === "my_post_type" ) {
$args['rewrite'] = false;
}
return $args;
}
add_filter( 'register_post_type_args', 'wpse206329_custom_post_type_args', 20, 2 );
Related Posts:
- I broke it! Custom post type archive gets redirected to home
- Remove plugin’s custom post type archive page and single pages [closed]
- Create a custom archive page for a custom post type in a plugin
- Media library – Limit images to custom post type
- Prevent trash/delete action on specific post types
- How to add custom content template part for a custom post type on main query using a plugin
- Displaying category archive of custom post types
- Filter for “get_post_type_archive_link()”
- echo value from ‘select’ field type into page template using cmb2?
- register_taxonomy with multiple object type and update_count_callback
- Multiple Paginations on one Page
- Page is defaulting to archive page and not designated template
- How often do you need to register_post_type?
- Add Capabilities to Custom Post Type after it has been created [duplicate]
- WordPress custom post type category pagination 404 Error
- Show Custom Post Type by Author
- Custom post type archive with pagination?
- Custom post type tag archives don’t work for basic loop?
- Maintaining WP_Query Relation Among CPT, Custom Taxonomy, Permalinks- CPT UI
- Disable single pages and archives and keep preview
- update a post meta from a single table cell TablePress
- Custom post type archive sorted and grouped by date in post meta field
- Custom post type with tags
- How to add post_author column to custom post type
- How to register custom post types in a plugin?
- List custom post type but redirects to home page
- Hide Meta Boxes for Non-Admins
- Issue to get wp_get_attachment_image with cmb2
- Best action hook to create custom post and assign taxonomy terms to it on plugin activation?
- Custom post type archive page pagination
- Need post_type_archive_title function but in ‘single’
- Shortcode insertion in tab
- Hierarchical Custom Post Types – Show only parent on tax archive?
- Custom post types archive redirect
- just can’t get date-based archives per post-type to work
- Archive page for taxonomy terms
- How can i change the output of posts_nav_link();
- Insert and then update post_type by wp_update_post
- add category name to permalinks on product page /category-name/product-name
- Custom Post Type with archive page but no detail page
- How to get post type and month/year before while loop for date.php file
- Action or Filter Hook for a Custom Importer
- How to set a CPT to have a page as a parent, then rewrite urls accordingly?
- Dynamic dropdown select values depending on other custom field value
- Post injections into Site Origins Page builder [closed]
- Custom archive page for CPT UI
- How to display custom post in archive section of the wordpress page?
- How can you use one database with multisite
- Archive for CPT
- How to add multiple images to a custom post type without plugin [closed]
- Custom Post type & Taxonomy 404
- How to create multiple editor?
- Custom post type, have only my meta boxes
- New “Custom Types” item in admin menu. Is this a plugin or a new wordpress feature?
- Set a hard-coded page-template (post-type-archive) as home/front-page of my wordpress blog?
- Archive links for custom post types
- Show All Custom Post Types On A Single Archive Page
- Can’t delete a custom post in front end with custom role
- Post URL based on Custom Post Types variables
- Archive Page for Multiple Custom Post Types
- Add custom field to admin area witthout using a metabox
- Can I assign a theme to a custom post type?
- Custom pages missing on “front page” setting
- Create Custom Post type that uses Page.php template
- Send post changes to set email addresses (not users or subscribers)
- How can I modify a custom post type and custom page template for a child theme if all content seams to be handled by theme’s ‘native’ plugin?
- Accessing a protected property of a post
- Multiple archives to display parent and subcategories content
- wordpress post_where set only for my costum post type
- Archive page for custom post type and custom taxonomy
- Custom post type 404 error on “default” or “numeric” permalinks
- How to have multiple archive pages?
- Create a Custom Path to Archive
- Advanced archive url structure (category, tag and date)
- Listing authors and date archive from custom post type
- WordPress sitemap with Custom Post Types
- Set a template on a custom post in the plugin
- Simple way to hide\show an announcement (just a div) on homepage?
- How to show custom post count in archive page
- Do not show child pages within a file page
- Restrict Custom Post Type to One Item
- Archive for custom taxonomy
- Add input radio menu to post
- Adding Custom Post Types to category/tag/author archives breaks header content
- Simple Data picker meta box
- Link two different post using there post_id in post meta
- Custom post type that lets users create a set of posts?
- Custom Fields through plugin in a Custom Post Type
- How can I generate a list of post-type specific categories?
- Remove custom post type generated by a plugin (The Events Calendar) [closed]
- Show custom taxonomy not in submenu
- Loop carousel slider in wordpress
- date archive future posts
- Keep same archive.php for post from archive?
- How to display custom post types AND regular posts separately on a shared taxonomy archive?
- Configure which plugin custom post types get registered
- ‘Blog Archive’ suddenly appeared on custom post type; how to remove
- Stop header code from showing in category page?
- How to get ‘Products’ on home page?
- Show custom category archive as front page and remove taxonomy slug from urls