WordPress.org

Ready to get started?Download WordPress

Forums

Custom Post Type UI
[resolved] Multiple rewrite slugs for one post type? (5 posts)

  1. relish1227
    Member
    Posted 1 month ago #

    Is there a way to have multiple rewrite slugs for one post type?

    Or, is there a way to not have the post type slug be the first slug in a URL?

    My problem is this: I have a product custom post type and it needs to exist in three areas of a site because I have three markets that are pretty mutually exclusive from each other. So, I'd like to have three unique URLs so that I can do different things on each iteration of the page, based on which market section it's in. I also want to take advance of caching and a CDN, so if I just have one URL, then I'm stuck with one static version of the page.

    I'm still thinking through options, but this is one that came to mind -- somehow having three versions of the URL somehow. Having three rewrite slugs might work... or if it was possible to have the CPT slug in a sub-directory.

    Thoughts? Thank you.

    https://wordpress.org/plugins/custom-post-type-ui/

  2. relish1227
    Member
    Posted 1 month ago #

    Ah, I just realized one thing that helps: the hierarchical setting for the CPT. If I set it to true, then I'm not stuck with a URL like

    http://www.mywebsite.com/product/product-name/

    When I really want it to be

    http://www.mywebsite.com/market/product/product-name/

    So that does answer one part of my post. But, ideally, I'd still like to use the same product record three times (the market being associated with the CPT using a custom taxonomy) and have three unique URLs.

  3. relish1227
    Member
    Posted 1 month ago #

    Actually I think I got too excited there. The "Hierarchical" setting only allows me to set the parent of the slug... but the other pages aren't available to be set as the parent. Only other CPTs of the same kind are. So that doesn't really help. Will keep mulling...

  4. relish1227
    Member
    Posted 1 month ago #

    Well, I'm going to close this because we've decided to just have three separate records, one for each market. This will be better for SEO and provides some more flexibility, too.

  5. Michael Beckwith
    Member
    Plugin Author

    Posted 1 month ago #

    Glad you were able to come to a solution one way or another relish.

Reply

You must log in to post.

About this Plugin

About this Topic