How to only use top category in permalinks

#150905
  • Resolved Hide Song
    Rank Math free

    Hello,
    I would like to only use the top level category in the permalinks of my posts.

    For example, lets say I have this category structure:

    [Parent]
    -Recipes

    [Child]
    –Appetizer
    –Main dish
    –Lunch
    –Soup
    –Dessert
    –Vegetarian
    –Etc…

    Now let’s say I create a post for “Garden vegetable soup recipe”, I would tag this post with the 3 following categories “appetizer” , “soup” and “vegetarian”.

    If I set my permalink structure to /%category%/%postname%/ this result in a url like :
    https://domain.com/recipes/appetizer/garden-vegetable-soup

    This is not what I would want, instead I would like :
    https://domain.com/recipes/garden-vegetable-soup

    I do not want to have any sub-categories in the url (most posts are associated with multiple sub-categories).

    Thanks,

Viewing 1 replies (of 1 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.

    If you don’t want to show the child category (appetizer in your example), you’ll need to select the recipes as your parent category.

    Please follow this screencast:
    https://i.rankmath.com/RIOFwr

    I hope that helps. Thank you, and looking forward to your update.

    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 1 replies (of 1 total)

The ticket ‘How to only use top category in permalinks’ is closed to new replies.