Add Primary Category to CPT slug

#662277
  • Resolved Maksym
    Rank Math free

    Hello,

    When I create post to the Blog, I have option to select “Primary” category. And slug of that category displays in URL (example: website.com/category-name/post-name

    By using JetEngine from Crocoblock I created CPT. When I create post in CPT, I also have option to select primary category, but I can’t see the name of category in the slug. Here is how URL of CPT looks like: website.com/cpt/post-name. I would like to have something like website.com/cpt/category-name/post-name.

    Is there an option in RankMath settings or PHP snippet that I could add to achieve that? I asked Crocoblock support, they told me to write to you.

    Thanks!

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

    Thank you for contacting Rank Math and bringing your concern to our attention. I’m sorry for the delay and for any inconvenience this issue may have caused you.

    For initial troubleshooting, please ensure that this option is enabled in Rank Math > General Settings > Breadcrumbs

    Bread

    And this is disabled as well

    bread2

    Let us know how this goes.

    Thank you.

    Maksym
    Rank Math free

    Hi Reinelle,
    Thanks for your reply!

    This is not exactly what I need.

    I have Custom Post Type “Cases”. I created it by using JetEngine plugin from Crocoblock.
    The URL structure of the CPT post is website.com/cases/post-name
    Post has selected primary category — https://ibb.co/PNXQKFX
    In this case “Branding campagne” category is selected.
    So I need URL structure to be website.com/cases/branding-campagne/post-name

    I enabled options on “Breadcrumbs” settings — https://ibb.co/hKB8VpN , but it didn’t help.

    Also, I have these settings in “Permalinks” — https://ibb.co/cC5z5sC

    And these in RankMath settings — https://ibb.co/ygXJk9N

    So how could I achieve this structure — website.com/cases/primary-category/post-name ?

    Thanks!

    Hello,

    The permalink structure you set for the posts doesn’t apply to the custom post types. You will have to use a permalink manager plugin to change the permalink structure of the CPT you have created and use the category slug in the post URLs.

    Hope that helps and please do not hesitate to let us know if you need our assistance with anything else.

    Hello,

    Since we did not hear back from you for 15 days, we are assuming that you found the solution. We are closing this support ticket.

    If you still need assistance or any other help, please feel free to open a new support ticket, and we will be more than happy to assist.

    Thank you.

Viewing 3 replies - 1 through 3 (of 3 total)

The ticket ‘Add Primary Category to CPT slug’ is closed to new replies.