How to switch from custom post type URL to category URL?

Your best bet will be a bunch of apache rewrite rules. Place something like this above the # BEGIN WordPress line in your .htaccess file: <IfModule mod_rewrite.c> RewriteRule ^subdirectory/(.*)$ /anotherdirectory/$1 [R=301,NC,L] </IfModule> So, using your example of redirecting /review to /reviews: <IfModule mod_rewrite.c> RewriteRule ^review/(.*)$ /reviews/$1 [R=301,NC,L] </IfModule> You can put as many rules as … Read more

Catch 404 after changing permalink structure from /%postname%/ to /%category%/%postname%/

That happens because WordPress reads your old post name as category name now – and it cannot find that category. Solution: filter 404_template and try to find the post and its permalink. Then redirect. <?php # -*- coding: utf-8 -*- /* Plugin Name: Redirect to category */ add_filter( ‘404_template’, ‘t5_redirect_to_category’ ); function t5_redirect_to_category( $template ) … Read more

Custom post type clean url

Generate WP can help you generate a clean CPT. If this doesn’t work, try the site to make sure you didn’t miss anything. // Register Custom Post Type function custom_post_type() { $labels = array( ‘name’ => _x( ‘Teams’, ‘Post Type General Name’, ‘text_domain’ ), ‘singular_name’ => _x( ‘Team’, ‘Post Type Singular Name’, ‘text_domain’ ), ‘menu_name’ … Read more