function rt_custom_post() {
register_post_type( 'book',
array(
'labels' => array(
'name' => __( 'Books' ),
'singular_name' => __( 'Book' ),
),
'public' => true,
'has_archive' => false, //this will eliminate the archive page
'supports' => array('title','editor','thumbnail'),
'publicly_queryable' => true
)
);
if you add :
'has_archive' => false,
to your register post type, it will remove the archive page. Remember to flush the permalinks by visiting the settings -> permalinks page after you make the change.
Make sure you didn’t create a page called book as well.
Related Posts:
- Remove slug from custom post type post URLs
- Add .html (dot HTML) extension to custom post types
- Possible to change the URL for the regular post type without affecting the URL of other custom post types?
- Use a separate upload folder for custom post attachment upload
- How to give a CPT (custom post type) a date based url
- URL for custom post type
- Custom Post Type Archive URL takes over page URL
- WordPress Custom Post Type Category Page
- How to Add Pages Under Custom Post Type URL Structure?
- Best Way to Leverage Custom Post Type Related Content and Consider SEO
- How to have a custom URL structure for a custom post type?
- Pagination throws 404
- Change the url of Projects in Divi Theme
- Creating multiple page URL without creating the pages in WordPress
- WordPress custom post type url change
- remove post-name from title in custom post type
- Rewrite Custom Post Type URL slug
- Get a permalink structure of /%posttype%/%category%/%postname%
- CPT posts listed by category with custom rewrite URL, please help!
- URI returns a post when it should return a 404
- Query string parameters from custom fields, inconsistent results
- Query var removed after rewrite
- Bizarre Permalinks Issue: 404 Errors Everywhere
- How to detect filter in URL in Category page?
- Custom Post type and permalink settings
- Custom Post Types, URL rewrite on multiple CPTs
- Get Taxonomy Term Title by it’s URL
- can I chage url for register_post_type
- How to add a post slug to a url?
- URLs for child terms
- Front custom edit post page for each post
- How to build custom route by adding taxonomies to URL ? ex: www.demo.com/communities/palo-alto/
- Remove the parent slug in a CPT URL
- create a subcatagory for a custom post type and out put url as posttype/subcategory/item
- Rewrite Question Mark in Post Template to Make it Pretty URL
- WordPress randomly shows 404 errors
- non-hierarchical post type with hierarchical url structure
- Taxonomy in URL
- Best structure / rewrite rules to achieve the following url
- CPT category hierarchy
- Create Custom Post Type as page
- retrieve permalinks of posts inside custom post type by using post ID
- How does: /index.php?post_type=event&event-date=2011-07-25 work? What if it doesn’t work?
- How to create connection among state, city, store and store number based on URL
- Custom Post Type Category URL
- How to create custom search result page with custom URL parameters for custom post type?
- Sanitize title only if only custom post type
- link featured image to external link
- How to display wp_post by custom field value?
- Custom post type URL
- How to add page under a custom post type?
- Changing custom post type URL issue
- Custom Post Type URL Rewrite’s
- Post/Custom Post Type URL Access
- returning the currect URL for nested posts
- how to achieve this permalink abc.com/CPTName/CustomPostTypeCategorySlug/categoryname
- I want to rewrite the URL of a specific post with a specific custom field to easily analyze in Google Analytics
- URL for archive of custom post type with 2 taxonomy terms
- Subpages URLs for Custom Post Type
- Query custom post type and custom field by URL parameters
- Modify Url for Edit Post Screen in Custom Post Type
- Add %post_id% to slug of custom post type and prevent the “unique slug” thing that WP does?
- Turning archive templates to a page template maintaining the slug
- CPT – Custom Text fields point to new url permalinks
- How to display a custom post as a page (but unedited)?
- WordPress Custom post type slug rewrite
- How to manage a custom post type archive as a page?
- How to manage a custom post type archive as a page?
- Custom Post – additional param in the custom post URL goes to error page
- Single Post (CPT) in two pages – Normal and Extended
- Remove wp directory and slug for custom post type from the URLs
- Do not output category and tag URLs
- Force WordPress to only match URL in category
- Custom post type clean url
- Custom post type with parent page? Possible?
- Get full control over custom post type url
- How to switch from custom post type URL to category URL?
- Custom url for custom post types
- Stop Custom post type from being searched via URL
- Why is a custom post type’s URL “/?cposts=name-of-the-post” but default post’s URL is “/?p=ID”?
- Custom Post Type Categories Not Maintaining URL structure any more
- Category slug not showing for Custom Post Type
- Customize category URL
- Remove custom taxonomy ‘post-type’ from post URL
- Cannot get query var ‘post_type’ to work
- Why are my wp urls showing page not found?
- Sorting custom post types by taxonomy (So close)
- Removing custom post type name in single article URLs
- create gallery page for specific post id
- Tags and Taxonomy links not working for Custom Post Types
- WordPress pagination URL
- img src not working correctly in custom post type
- Links in archive not including taxonomy parameter
- Menu Structure and URL structure, with Pages and Post-Type-Posts
- Custom Post Type with multiple Custom Taxonomies / Hide Taxonomy Slug from URL
- Hide custom post type slug url from search engine [closed]
- Is it possible to use a post name in a custom post slug?
- Rewrite rule taxonomy url with different values in one function
- Change post-name when inserting new Post if Specific Category is selected in WP
- How do I get parameters from the URL?