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]
- Is It Possible To Add Custom Post Type Menu As Another Custom Post Type Sub Menu
- Custom Post Type Archives by Year & Month?
- Get custom post type slug for an archive page
- Create a custom archive page for a custom post type in a plugin
- Media library – Limit images to custom post type
- Custom post type pagination 404 fix?
- How to Add Custom Taxonomy To Woocommerce Plugin
- Adding content to archive and taxonomy pages on custom post types?
- Filtering a custom post type by custom taxonomy in archive template
- Permalink Structure for Multiple Post Type Archives by Taxonomy
- get term archive url / link
- How to get the custom post type from an archive page?
- How to remove “Archive:” label from archive title
- Development of a WordPress Search Plugin – Best Practices
- Why are posts from custom post type not displayed in “category” archive?
- Prevent trash/delete action on specific post types
- Custom Post Type Archives by Date and Taxonomy
- 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
- Custom post types – Use post_id in permalink structure when using has_archive => true
- Meta_Query as a way how to setup CPT permalinks – is it a good thing?
- Change capability type of post type registered by plugin
- $query->set in pre_get_posts is unintentionally affecting the backend
- Pagination throws 404 error on custom taxonomy archive pages
- Setting up custom post type archives in WP3.1? Any luck?
- Proper way of making custom post type landing page or archive page
- How do I display two separate taxonomy archives for two post types that share a single taxonomy?
- Custom Post Type Archives by Date with Custom Permalink
- Filter for “get_post_type_archive_link()”
- How to add meta box to backend menu page
- Custom Post Type Archive Page: Set Posts Per Page, Paginate
- Rewriting ‘rewrite’ slug for custom post type used by plugin
- Change title in head on Archive page
- echo value from ‘select’ field type into page template using cmb2?
- Display Editable Text Above CPT Archive Listings
- Custom Post Type Archives with 0 Posts Redirects as 404
- How to show more posts on an archive page?
- Archive page with multiple taxonomies rewrite
- register_taxonomy with multiple object type and update_count_callback
- Multiple Paginations on one Page
- Create permalink structure for one taxonomy archive per custom post type
- Archive page…limiting posts per page
- WP 3.1 – archive pages for custom content types possible now without a plugin?
- Page is defaulting to archive page and not designated template
- How often do you need to register_post_type?
- Date archives for custom post type
- Custom Post Type Archive URL takes over page URL
- Custom comment status possible?
- post_type_link filter causes 404 on the CPT page it’s used on
- Better to use a post type archive, page template, or shortcode for generating a highly configurable CPT archive?
- How to use a dedicated template for the Custom Post Type from a plugin?
- Display all custom post types in archives.php
- Add Capabilities to Custom Post Type after it has been created [duplicate]
- How to Add Pages Under Custom Post Type URL Structure?
- Custom Post Type Archives by Date (stored as meta value) WP3.1
- WordPress custom post type category pagination 404 Error
- Custom Permalinks for Custom post Type Archives?
- is_singular won’t call my functions?
- Show Custom Post Type by Author
- Custom post type archive with pagination?
- Include images from pages in wp search.php results in default wp search
- Custom post type tag archives don’t work for basic loop?
- Separating Search Results By Post Type
- List events by month
- Removing CPT slug from URL results in 404 error for archive page
- Date query for a custom meta field
- Multiple post types in archives (filter?)
- Pages, Custom Posts & Custom Taxonomy defining slug structure
- How to show a tag archive of one post type only
- Maintaining WP_Query Relation Among CPT, Custom Taxonomy, Permalinks- CPT UI
- How to let custom post type posts show in standard post archive (like in homepage)?
- Regex problem in an add_rewrite_rule
- paginate function in archive for custom-post-type
- Custom taxonomy archive page not working
- Include Custom Posts Type in Year/Month/Date Archive
- Getting arguments for register_post_type from a plugin generated post type
- where can I see my custom post type archive template?
- wrong template for page of archive
- How to show multiple post types on taxonomy archive?
- Call different archive page based on post type
- Disable single pages and archives and keep preview
- update a post meta from a single table cell TablePress
- update custom post type meta from a shortcode
- Custom post type archive sorted and grouped by date in post meta field
- Remove POST_TYPE from custom post type permalink
- Query posts between two dates (custom meta keys) CMB2
- How to localize value of posts
- Custom post type with tags
- Used with meta_query in query_posts works slowly
- Change upload_dir folder at a certain cpt but cant change back
- How to add post_author column to custom post type
- How to register custom post types in a plugin?
- How to create archive page for taxonomy terms within custom post type
- List custom post type but redirects to home page
- Display custom taxonomy as dropdown list
- Custom Post Type with static page for archive
- get_categories for custom post type and filter by custom taxonomy (brand) and list child categories of a defined category
- Category and post tag archives do not include posts from custom post type