Title: Custom Post Type Plugin 404 Error
Last modified: August 20, 2016

---

# Custom Post Type Plugin 404 Error

 *  Resolved [ajcke](https://wordpress.org/support/users/ajcke/)
 * (@ajcke)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/custom-post-type-plugin-404-error/)
 * I’ve created a custom post type plugin ([following a tutorial](http://wp.tutsplus.com/tutorials/plugins/a-guide-to-wordpress-custom-post-types-creation-display-and-meta-boxes/)).
   When I add a new post and then view the post I get a 404 error. Below is the 
   code in the plugin.
 *     ```
       add_action( 'init', 'create_movie_review' );
       function create_movie_review() {
           register_post_type( 'movie_reviews',
               array(
                   'labels' => array(
                       'name' => 'Movie Reviews',
                       'singular_name' => 'Movie Review',
                       'add_new' => 'Add New',
                       'add_new_item' => 'Add New Movie Review',
                       'edit' => 'Edit',
                       'edit_item' => 'Edit Movie Review',
                       'new_item' => 'New Movie Review',
                       'view' => 'View',
                       'view_item' => 'View Movie Review',
                       'search_items' => 'Search Movie Reviews',
                       'not_found' => 'No Movie Reviews found',
                       'not_found_in_trash' => 'No Movie Reviews found in Trash',
                       'parent' => 'Parent Movie Review'
                   ),
   
                   'public' => true,
                   'menu_position' => 15,
                   'supports' => array( 'title', 'editor', 'comments', 'thumbnail', 'custom-fields' ),
                   'taxonomies' => array( '' ),
                   'menu_icon' => plugins_url( 'my-photo-sessions/camera.png', __FILE__ ),
                   'has_archive' => true
               )
           );
       }
       ```
   

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [catacaustic](https://wordpress.org/support/users/catacaustic/)
 * (@catacaustic)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/custom-post-type-plugin-404-error/#post-3574039)
 * I’ve found that a lot of times you need to reset your permalinks when you add
   a new custom post type because it doesn’t update WordPress’s internal routing
   without doing that. Just go to ‘Settings -> Permalinks’ and change to ‘Default’
   then back to what you have set now and try again and it should work.
 *  Thread Starter [ajcke](https://wordpress.org/support/users/ajcke/)
 * (@ajcke)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/custom-post-type-plugin-404-error/#post-3574079)
 * Thanks! That did the trick.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Custom Post Type Plugin 404 Error’ is closed to new replies.

## Tags

 * [custom post type](https://wordpress.org/support/topic-tag/custom-post-type/)

 * In: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
 * 2 replies
 * 2 participants
 * Last reply from: [ajcke](https://wordpress.org/support/users/ajcke/)
 * Last activity: [13 years, 2 months ago](https://wordpress.org/support/topic/custom-post-type-plugin-404-error/#post-3574079)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
