#How to rewrite URI of custom post type #http://wordpress.stackexchange.com/questions/33551/how-to-rewrite-uri-of-custom-post-type/33555#33555 add_filter('post_type_link', 'wpse33551_post_type_link', 1, 3); function wpse33551_post_type_link( $link, $post = 0 ){ if ( $post->post_type == 'product' ){ return home_url( 'product/' . $post->ID ); } else { return $link; } } add_action( 'init', 'wpse33551_rewrites_init' ); function wpse33551_rewrites_init(){ add_rewrite_rule( 'product/([0-9]+)?$', 'index.php?post_type=product&p=$matches[1]', 'top' ); }