What you’re observing is normal behavior. Registering a post type does not add any data to the database, but adding a new post once the post type has been registered does add data to the DB. Removing the post type registration code will not remove data.
Head over to Settings > Permalinks and click Save Changes. That should fix the 404 error.
Note that if the post type name is changed, when re-adding the post type, the data will not be available for the newly named post type.
Related Posts:
- Get terms by taxonomy AND post_type
- Permalink Structure for Multiple Post Type Archives by Taxonomy
- Allow user to Edit Posts but not Add New?
- WordPress 4.4+ : How to revision CPT + metadata
- How can I filter posts by post_parent in the admin?
- Highlight menu item when on a custom post type?
- Rewriting ‘rewrite’ slug for custom post type used by plugin
- Using Templates with Custom Post Type UI
- Post slug changed using code doesn’t reflect on editor when post is published
- Detect meta value changes when post is updated (post_updated)
- How to setup a Custom Taxonomy Term template
- Remove Custom Post Type menu for non-administrator users.
- Using Query Posts With Multiple Post Types And A Taxonomy
- Retrieve a specific field from taxonomy term through advanced custom fields [closed]
- Display Custom Post Type in divs just thumb and title
- Custom Taxonomy List links being re-written
- wp_list_categories and custom post types
- How to show particular category all post in custom single file
- Bulk 301 redirect for custom post type
- Associate Taxonomies Across Post Types
- ‘category__and’ for custom taxonomy?
- Custom field default value with counter
- Custom post type hierarchical permalinks not behaving as expected for parent/child pages
- Warning when attempting to edit/add custom post type
- Changing ‘view’ link for custom post type on list post screen?
- Check if a specific custom field exists?
- How does register_post_type know how and which function to use from the add_action function?
- Fetch ID’s associated with a custom post type when translated with WPML?
- Custom post type show on both Home and Date Archive
- Create custom PAGE with register_post_type
- Custom post types archive redirect
- Update CPT post meta with update_post_meta and cron job
- Can’t query tag and post_type at the same time
- Moving ‘register_post_type’ to seperate file not working
- Get post from custom post type order by two taxonomies
- Checking if Post Title is Unique as Loop Criteria
- Custom Taxonomy Archives on Custom Post type Page [duplicate]
- Override a page template from a plugin in a child theme
- Display custom fields from custom posts in RSS feed
- On update or create post redirect to current post position in list
- Can I override a CPT template on a per post basis with Gutenberg block editor?
- Versioned Custom Post Type (Not the same as revisions)
- Is it better to use WordPress Custom Post Types or Taxonomies?
- A custom post within a custom post
- custom post type pagination error 404
- Display Woocommerce Orders for specific author [closed]
- What’s the equivalent of Hide From Menus on MODX on WordPress?
- TinyMCE style formats for different post types
- Lost of query parameter when using permalink
- How to add multiple images to a custom post type without plugin [closed]
- get_the_title() is returning results from previous loop
- Moving meta boxes in admin
- Post-thumbnail only for specific post-types?
- Add post meta programmatically to attachment
- Custom Posts values in custom post overview
- Get Specific Template Part if Custom Field is Some Value
- Page as Archive page
- 3 random images from custom post type, each in a div with a diffrent class
- Displaying multiple post types on home page
- Shortcode leaves no space for other elements?
- Show All Custom Post Types On A Single Archive Page
- Query to get child pages of current page and display it in action hook
- Can’t replace the default sidebar with a custom sidebar on Custom Post Type in Genesis
- Dynamic category name in query post
- Two queries – one with checkbox ticked, one without – comparing meta_query
- custom post archive URL is wrong
- Can I decide what categories show on my posts page?
- How do I call the custom Post Type name and permanent link to my php file?
- Mandatory field in Custom post
- Filter custom post type admin list by custom meta column, where the column is another custom posts meta value
- Link custom post type to users membership
- In child theme, add CPT to custom taxonomy registered in parent theme
- How to display posts with plugin (advanced custom fields) field groups?
- WordPress – display relationship between blog posts and custom posts
- Custom taxonomies not displaying in some custom posts
- Load info from customposttype into template page
- Multiple Loops In Tabs Only Displaying First Loop
- From CPT Custom Loop into Shortcode?
- WP_Query to display number of custom post type filtered (order by) taxonomy
- Custom taxonomy terms registered not showing when added in child theme
- How to assign post to category
- WordPress deletes custom posts instead of trash them
- Creating custom post type relationships
- How to create groups like that in buddypress?
- Display all Custom taxonomy terms and their relevant custom posts
- wordpress query_posts with foundation 6 Accordion not working correctly
- Include template if a post is a single product
- Allow viewing the edit screen for a post type, but not make/save/publish/update changes
- Render custom taxonomy query as single template
- Is it possible to make one of two custom fields in Custom Post Type UI Required but not the other?
- adding a shortcode into a custom post type
- Custom Post within a custom post
- General question about Parent and Child Post type relationships
- Custom My account page and custom page for editing posts
- What’s the best way to show custom post types? With page template it’s not perfect!
- show custom post types for a month
- How to write an if statement which reads: ‘if is this custom post type or a child of it do the following’?
- Post count for particular term
- wordpress custom post type shows other cpt posts in admin menu
- post__in select all custom posts and not the selected array of ids