WooCommerce Product Permalinks

#248092
  • Resolved Mike Harding
    Rank Math free

    Hi there. We are using the Rank Math plugin on a WooCommerce site at https://s.cookslarder.co.uk.

    We seem to be experiencing a strange issue with product permalinks.

    The product permalink structure is set as:

    /shop/%product_cat%/

    Which generates permalinks e.g. https://s.cookslarder.co.uk/shop/fruit-and-veg/fruit/braeburn-apples/

    Normally, when we change the product category, the permalink also changes to reflect this.

    There appears to be an issue / conflict between Rank Math and WooCommerce specifically when you duplicate a product.

    After duplicating a product using WC’s “Duplicate” option, the permalink no longer changes to match the product category.

    I have tested this by deactivating all plugins apart from WooCommerce and Rank Math, and also by switching to the default Storefront theme and the issue persists, which leads me to believe that it may be an issue within Rank Math that is not allowing these permalinks to change.

    As I say, this is only happening on products that have been duplicated.

    Would you be able to investigate this? If we can’t find a solution then we will have to switch back to the Yoast plugin.

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

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

    I’m not quite sure whether I fully understand your concern. But I’ll do my best, and please let me know if I misunderstood.

    Do you mean the duplicated product URL is not the same as /shop/fruit-and-veg/fruit/braeburn-apples/?

    Also, you mentioned:

    After duplicating a product using WC’s “Duplicate” option, the permalink no longer changes to match the product category.

    Could you please provide the URL generated here to check? You can also share some screenshots using this tool.

    Looking forward to helping you.

    Thank you.

    Hi there thanks for your response.

    I’ll walk through the process:

    1. You start with an existing product. The category in this case is

    Fruit & Veg > Fruit

    and the permalink is

    /shop/fruit-and-veg/fruit/braeburn-apples.

    Screen shots:

    https://www.dropbox.com/s/oyiqr27ecmcgao6/Screenshot%202021-08-23%20at%2015.29.12.png?dl=0

    https://www.dropbox.com/s/60e3o4ep3x2k23d/Screenshot%202021-08-23%20at%2015.25.40.png?dl=0

    2. If you duplicate this product, WooCommerce just appends -copy to the permalink, e.g:

    /shop/fruit-and-veg/fruit/braeburn-apples-copy

    All fine so far.

    3. If you then change the product category, the category base does not change within the permalink.

    For example if I change the product category on the duplicated product to

    Meat & Fish > Beef

    we would expect the permalink to change to

    /shop/meat-and-fish/beef/braeburn-apples-copy

    but it doesn’t – it just retains the category base at the time the post was duplicated.

    It only seems to be happening on duplicated products. If we create a new product from scratch and alter the categories, the category base changes as we would expect.

    Hope this clarifies things a little bit.

    I suspect it might be an uncommon issue as we are not using the default permalink structure for products which is normally just /product/[product title] and therefore doesn’t include any category components.

    Nevertheless, it is strange that it is only affecting duplicated products.

    Hello,

    Thank you for the detailed instructions.

    However, I’m unable to replicate the issue on our test install. Please refer to this screencast:
    https://i.rankmath.com/yB4kTA

    On my WordPress dashboard > Settings > Permalinks, I’m using the Shop Base with category option.

    Could you please confirm if you have already selected the Product Categories in Rank Math > Titles & Meta > Products > Primary Taxonomy?

    Primary Taxonomy

    If not yet, please do so and let us know if the issue still persists.

    I hope that helps.

    Thank you.

    Hi Reinelle thanks.

    It turns out that the setting you mentioned in Rank Math > Titles & Meta > Products > Primary Taxonomy was the solution.

    Once I set that to Product Categories that resolved the issue and the permalinks would update on duplicated products.

    I am using the Shop Base with category option in the Permalink Settings.

    I wonder if you change the Primary Taxonomy setting on your test site to None can you then reproduce the issue then?

    Hello,

    Yes, I was able to replicate the issue when the Primary Taxonomy is selected as None in Rank Math settings.

    However, that is the intended behavior. Since you’re updating a duplicated page, the category should be selected as primary term to update the URL as well. Otherwise, the categories for that duplicated page will remain the same.

    I hope that helps.

    Thank you.

    Hi Reinelle thanks for confirming.

    I would argue though that having to explicitly set the Primary Taxonomy option is an issue with the plugin because if that option is not explicity set the default behaviour that WooCommerce provides is broken.

    Ideally the plugin shouldn’t affect any of the default behaviour when it is enabled, unless it is made clear to the user.

    Not sure whether you could make this clearer for WooCommerce site admins somehow – maybe make the option a requirement if the plugin is running alongside WC? Or at least show a message somewhere to explain it?

    Something like this would have avoided us having to submit this ticket.

    Thanks.

    Hello,

    We appreciate your feedback regarding the situation and we’ll log this as a suggestion for further discussion with the product team.

    If you have any other questions or require any further assistance don’t hesitate to get in touch.

    We are here to help!

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

The ticket ‘WooCommerce Product Permalinks’ is closed to new replies.