I have a CPT called "case-studies" and the slug of the archive page of this CPT is www.my-domain/case-studies
and the slug of the CPT posts is www.my-domain/case-studies/case-study-name
.
Now, for SEO purposes, I have to change the slug of the archive page to "testimonials-case-studies" so the slug for the "case-studies" archive page it has to be www.my-domain/testimonials-case-studies/
and the slug for the posts have to be www.my-domain/case-studies/case-study-name
(same as before).
What is the best way or the solution for this?
What I have tried so far is:
creating a custom page template and change the slug of the page to
/testimonials-case-studies/
and redirect/case-studies/
to/testimonials-case-studies/
but the postswww.my-domain/case-studies/case-study-name
are not working because there is a problem with redirection.Using:
'rewrite' => array( 'slug' => 'testimonials-case-studies', 'with_front' => false ),
In the custom post type BUT the slug for the post change to www.my-domain/testimonials-case-studies/case-study-name
but IT HAS to be: www.my-domain/case-studies/case-study-name
Is there a possible solution for this?
I have a CPT called "case-studies" and the slug of the archive page of this CPT is www.my-domain/case-studies
and the slug of the CPT posts is www.my-domain/case-studies/case-study-name
.
Now, for SEO purposes, I have to change the slug of the archive page to "testimonials-case-studies" so the slug for the "case-studies" archive page it has to be www.my-domain/testimonials-case-studies/
and the slug for the posts have to be www.my-domain/case-studies/case-study-name
(same as before).
What is the best way or the solution for this?
What I have tried so far is:
creating a custom page template and change the slug of the page to
/testimonials-case-studies/
and redirect/case-studies/
to/testimonials-case-studies/
but the postswww.my-domain/case-studies/case-study-name
are not working because there is a problem with redirection.Using:
'rewrite' => array( 'slug' => 'testimonials-case-studies', 'with_front' => false ),
In the custom post type BUT the slug for the post change to www.my-domain/testimonials-case-studies/case-study-name
but IT HAS to be: www.my-domain/case-studies/case-study-name
Is there a possible solution for this?
Share Improve this question edited Sep 29, 2019 at 21:26 wittich 1732 silver badges10 bronze badges asked Jul 5, 2018 at 16:03 andresglandresgl 1641 gold badge3 silver badges14 bronze badges1 Answer
Reset to default 17Pass the desired archive slug via has_archive
:
$args = array(
'rewrite' => array( 'slug' => 'case-studies' ),
'has_archive' => 'testimonials-case-studies',
);