This is usually due to the rewrite rules not being updated. You need to run flush_rewrite_rules()
or visit the Permalinks page in the WP-Admin and save it to flush the rewrite rules. If you use the function call in your plugin, be sure not to leave it in such that it gets run every time, it’s not friendly that way.
Related Posts:
- Change plugin’s has_archive = true to false?
- 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?
- 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
- Remove POST_TYPE from custom post type permalink
- How to add post_author column to custom post type
- List custom post type but redirects to home page
- Custom Post Type with static page for archive
- Issue to get wp_get_attachment_image with cmb2
- Need post_type_archive_title function but in ‘single’
- Second Custom Post Type Archive
- How to show the archive / post type description on Single templates
- is_main_query() not working for WP REST API
- Hierarchical Custom Post Types – Show only parent on tax archive?
- Can’t get order_by meta_value_num to work properly
- Archive page for taxonomy terms
- Show listings from Impress Listing plugin in random order using taxonomy and terms
- How can i change the output of posts_nav_link();
- One-to-many post relationships that are displayed by category (using posts-to-posts plugin)
- Custom posts don’t work
- single-{cpt}.php ignored
- Insert and then update post_type by wp_update_post
- Custom Post Types. Are there any disadvantages/advantages in using a plugin to develop them?
- Why is my site using index.php instead of archive?
- Addition of custom option panel crashes Media Library & Admin Area
- Dynamic dropdown select values depending on other custom field value
- Custom post type archive page blank
- WordPress randomly shows 404 errors
- Custom Post Type slug same as page name
- How to Get WordPress custom post data in WooCommerce product meta panel? [closed]
- How can you use one database with multisite
- Archive for CPT
- Archieve.php not loading for custom post type
- Custom post type, have only my meta boxes
- Dynamically insert an article at the top of a taxonomy archive – or?
- Archiving custom post content?
- Pagination hitting 404 page on /page/4
- Can’t delete a custom post in front end with custom role
- Archive Page for Multiple Custom Post Types
- Add custom field to admin area witthout using a metabox
- Can’t access private custom posttype single- or archives-page
- Override Plugin Custom Post Type ‘single’ view
- Can I assign a theme to a custom post type?
- Add custom columns in custom post type browse page
- Create Custom Post type that uses Page.php template
- Plain links in single-class.php and archive-class.php not working
- wordpress post_where set only for my costum post type
- Archive page for custom post type and custom taxonomy
- how can i show a google map in custom post type
- Why does my URL keep returning 404 error code?
- Display CPT index page as front/home page
- Create a Custom Path to Archive
- Advanced archive url structure (category, tag and date)
- Display all Categories except ones with a specific parent
- Archive per year of a custom post getting the wrong post
- Creating archive like functionality through birectional relationships
- How to show custom post count in archive page
- Why is this function so slow?
- Do not show child pages within a file page
- Permalink URL connection between two custom types
- Taxonomy counter on Taxonomy List(plugin)
- Is it possible to arrange Custom Post Types from CPTUI into a Folder?
- Multiple useres editing specified content
- Filter Custom Post Type Posts by Taxonomy
- Custom post type categories giving 404
- Insert custom taxonomy into category query
- Custom category taxonomy – archive page not showing up
- How can i remove post type archive URL?
- Custom post type URL structure with site.com/custom_taxonomy_slug/post_name
- Link two different post using there post_id in post meta
- Custom post type that lets users create a set of posts?
- Custom taxonomy archive slug overwrites static page
- 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?