I've a custom post type by name 'Portfolio'. It's generating the url as /portfolio/xxx when I make any post. I want to change it to 'Products'. Change custom post-type rewrite I've tried this but it doesn't suppose to work.
I am presuming you have added the custom post type yourself, in which case it is easy.
When you register a new post type, you can set any rewrite rules for that post type to follow as part of the arguments used in the register_post_type( 'name', $args )
function.
If your post type is available on the front end and is public, then by default WordPress will use the custom post name as the slug. You can override this as follows:
$args = array(
// your other arguments
'rewrite' => array(
'slug' => 'products', // use this slug instead of post type name
'with_front' => FALSE // if you have a permalink base such as /blog/ then setting this to false ensures your custom post type permalink structure will be /products/ instead of /blog/products/
),
);
register_post_type( 'portfolio', $args );
The other arguments you can use are documented at http://codex.wordpress.org/Function_Reference/register_post_type