WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a category on my website called 'profiles' I am in the process of moving this category to a custom post type called 'profiles'.

My problem is I cannot get the archive page to show for this custom post type. When I go to the url mywebsite.com/profiles it takes me to a single post page for a post in the profiles category.

I have included has_archive = true; in my functions.php

I didn't have a problem creating an archive page for another custom post type I did on the same website so Im really lost as to why this is not working this time.

Any advice would be most appreciated?

add_action( 'init', 'profile_custom_init' );

/* Here's how to create your customized labels */
function profile_custom_init() {
$labels = array(
    'name' => _x( 'Profiles', 'post type general name' ), // Tip: _x('') is used for localization
    'singular_name' => _x( 'Profile', 'post type singular name' ),
    'add_new' => _x( 'Add New', 'Profile' ),
    'add_new_item' => __( 'Add Profile' ),
    'edit_item' => __( 'Edit Profile' ),
    'new_item' => __( 'New Profile' ),
    'view_item' => __( 'View Profile' ),
    'search_items' => __( 'Search Profile' ),
    'not_found' =>  __( 'No Profile found' ),
    'not_found_in_trash' => __( 'No Profile found in Trash' ),
    'parent_item_colon' => ''

// Create an array for the $args
$args = array( 'labels' => $labels, /* NOTICE: the $labels variable is used here... */
    'public' => true,
    'publicly_queryable' => true,
    'has_archive' => true,
    'show_ui' => true,
    'query_var' => true,
    'rewrite' => true,
    'capability_type' => 'post',
    'hierarchical' => false,
    'menu_position' => 10,
    'supports' => array( 'title', 'editor','thumbnail', 'excerpt', 'custom-fields' ),
        'taxonomies' => array('category')

    register_post_type( 'profile', $args ); /* Register it and move on */
share|improve this question
Try changing profile category slug to something else like profiles-2. – Vinod Dalvi Mar 4 '13 at 10:45
Doesnt seem to work. Also if I go to the url mywebsite.com/his for example instead of taking me to a 404 page (I dont have any page or post called just 'His') it takes me to a post beginning with the word 'his'. This seems very strange? – stemie Mar 4 '13 at 10:55
Have you tried to save your permalink structure again? This causes the rewrite rules to be regenerated. – Mike Madern Mar 4 '13 at 11:03
Try re saving permalink structure by clicking on Save Changes button of Permalink Settings. – Vinod Dalvi Mar 4 '13 at 11:04
  1. Go to Settings->permalinks and change the permalink structure to Default.
  2. After saving the permalink as default revert it to custom structure or post name, it should work and i have tested this.

I hope this can help you.

share|improve this answer
up vote 0 down vote accepted

Re saving the permalink structure seemed to fix the issue. Thanks for the tip Mike and Vinod.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.