How to Change Custom Post Type URL?

If you have already a custom post type and you want to change the slug/url of the post, please follow the below instruction

Search your theme/plugin for register_post_type function and check if the function exists rewrite parameter. If it doesn’t exists add it following the below:

$args = array(
    // your other arguments

    'rewrite' => array(
        'slug' => 'portfolio-cat', // use your desire slug instead of post type name
    ),
);

register_post_type( 'portfolio', $args );

 

More about register_post_type please check the below link:

https://developer.wordpress.org/reference/functions/register_post_type/

Thank you!

Leave a Reply

Your email address will not be published.