you cannot remove a hook when you are in the same hook with the same priority.
a solution is to hook the action with a lower priority
add_action('init', 'remove_cpt', 5);
Related Posts:
- How to enqueue scripts on custom post add/edit pages?
- Unregister post type from child theme
- flush_rewrite_rules on save_post Does Not Work on First Post Save
- With what hook can I address all posts from all custom post types when they are published?
- What hook should be used to programmatically create a post only when master post is updated?
- How to register custom post types in a plugin?
- Remove “Get Shortlink” button in admin of custom post type
- How to: Display ACF [fields] on Custom Post Types Utilising WordPress ‘Hooks’? [closed]
- Filter Posts from the Main Query
- Use remove_meta_box conditionally on custom post type
- wp_trash_post action hook with custom post type
- How do I amend form data before it is saved for a custom post type
- How to recover the post ID earlier in the WP admin hook action “firing” sequence?
- Using `set_transient()` when saving a custom post type
- Using publish_{custom-post-type} hook for custom post type to update meta doesn’t work
- How to store additional data that is related to core data
- do action inside a class is not working
- Create action running on trashed_post hook to modify post_meta value
- Hook for post and page load
- How do you use a CPT as the default home page?
- remove custom post type permalink
- How to Debug the ‘save_post’ Action?
- How to change “Draft” string for status of custom post type to “Unavailable”?
- Adding a drag and drop re-ordering from a custom post type default list [closed]
- Custom post type save_post action not firing
- Filter for “get_post_type_archive_link()”
- Why The Init Hook For Custom Post Types
- How to hook into the CPT’s title placeholder?
- How to show more posts on an archive page?
- Why get_next_post_link() or get_previous_post_link() doesn’t return the required links?
- How often do you need to register_post_type?
- How to set a custom post type post as static front page?
- Dynamically Create Terms in Taxonomy when Custom Post Type is Published. Almost There!
- WordPress Custom Shortcode Conflicting with Media Library
- Hook when adding or editing a specific custom post type? [closed]
- remove_action conditionally for Custom Post Type
- WordPress custom post action hook
- Custom post type archive sorted and grouped by date in post meta field
- Creating a function that receives the taxonomy terms that have been changed in a custom post type
- pre get posts changing the query
- Actions that Run on Admin Edit Page Load After Posts Are Queried
- Add information above a custom post type listing of all posts page
- Using pre_get_posts to Filter Posts
- How to get Custom Post ID by adding filter to child theme’s function
- Custom post_type search’s $wp_query->query_vars do not correspond
- Custom Blog Post Listing in Genesis Sample Child Theme
- Add html to cpt main page / admin edit.php
- register_taxonomy and register_post_type does not work [closed]
- Hooking in to an archive page?
- Why is conditionally loading a custom plugin’s code only on a specific custom post type causing the site content to disappear?
- Custom post type unintentionally called in every page
- Posts are duplicating on wp_post_update
- Displaying custom taxonomy in the admin list of a custom post type
- Can taxonomies of custom post types be used with category actions?
- A method for ordering mixed dates in search result loop (theory only, no actual code)
- How do I add a custom screen for a custom post type to be called from custom post row action?
- Custom post type suppress transition from future to publish
- Categorise Custom Post Types
- Using preg_replace to filter custom textarea
- How can I add a filter to a particular post format?
- Is there any way to get list of all possible filter hooks for all post types?
- Add a custom text to admin footer in a Custom Post Type page
- Custom Meta fields Update hook?
- Include php on a specific page template
- Add an Outside Wrapper to my Header and Make it Full Width
- What do the numbers mean at the end of add_action(‘save_post’)…?
- Running a wordpress action when a custom post type term (taxonomy category) is changed
- sortable columns for multiple custom post types not working
- How check if a post is saved from backend or frontend?
- How to build a WordPress post review system beside commenting
- WordPress hook after post content and meta update
- ACF for custom post type archive pages: which hook to use?
- Assigning alternate single-{cpt} template based on blog_id in multisite
- providing access to post_id or post inside functions.php
- Before saving post hook
- Make a custom column sortable by a value from a different custom post type
- wordpress post_where set only for my costum post type
- How can I get some of a posts meta data whilst it is still inserting?
- What hook can I use to modify custom post data before it is displayed on the page?
- Catch and display error on save_post action
- Limiting actions only to edit.php page for specific custom post type
- Best way to fix bad count on All | Mine | Published
- wp_set_object_terms creates taxonomies but does not add custom posts to it
- Add html tot CPT edit screen – no metabox
- Custom Post Type action on post update
- Show Post Types customized in Template Page
- In child theme, add CPT to custom taxonomy registered in parent theme
- Store a value in global scope after init hook is fired
- Update main post with same category when creating custom post to update the modified date
- publish_post action callback not executed, why?
- Correct way to register custom post type from external php file?
- Execute code only after user clicks ‘update’ button for CPT being edited
- Adding Information To All Posts Screen
- Customizing a plugin function using a hook
- Hook only specific post type
- What is the proper way implement a global $wp_rewrite?
- Custom post type functions.php if statement on action
- How to string lines from the_content() hook in WordPress?
- Redirect drafted post of custom post type to URL?
- Change CPT Edit Target Link for Admin List