Support » Fixing WordPress » Change Custom Post Type Slug, then REDIRECT

  • Hello there,

    We have been looking into this for a while but haven’t found a good resource, hence here is our question:

    1) We are planning to change the slug of a Custom Post Type, so instead of we get

    2) The problem is that we don’t want to lose all the traffic coming from external links, and we are looking for the best way to handle the redirection. We rather not to use a pluging for this. Would mod_rewrite on the .htaccess file the way to go? Should we change anything on the databases -other than flushing the permalinks trough the WP dashboard?


Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi aderojas,

    use 'rewrite' => array('slug' => 'your-slug-here'),

    here is an example

    			'labels' => array(
    				'name' => 'Packages',
    				'singular_name' => 'Package'
    			'public' => true,
    			'has_archive' => true,
    			'rewrite' => array('slug' => 'package-type'),
    			'supports' => array('title', 'editor', 'excerpt', 'thumbnail','comments'),
    			'can_export' => true,

    remember to refresh the permalink settings.

    Thanks Dhanukanuwan!

    We discovered we had something else going on with the redirections so we are going to wait to change it until we redesign the site, but this definitely helps!

    You are welcome 🙂

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Change Custom Post Type Slug, then REDIRECT’ is closed to new replies.