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.
This issue is with our option to remove the category base /product-category/.
The compatibility for the feature needs to be added by Polylang, and they are not willing to add compatibility for our plugin. We have tried to reach out to them many times but since they aren’t willing to add the compatibility, there is nothing we can do to make the options work with their plugin.
For your product categories to work the same as your translated URLs, you should disable the Remove Category Base option for now in Rank Math > General Settings > WooCommerce:

Looking forward to helping you.
We have been able to fix the issue with this code after studying Polylang a bit more. We are very happy with Rank Math, and if we continue to experience problems with Polylang or if necessary, we will consider switching to another language plugin. However, for now, we have resolved the issue with this code, and we’re sharing it here for anyone who might find it useful.
Thank you for your quick response, it has been very helpful. On the other hand, we have received no response from Polylang—just silence—for over three months of waiting.
// Check if Polylang is active before executing the function
if (function_exists('pll_the_languages')) {
// Hook to remove rewrite rules upon theme setup
add_action('after_setup_theme', 'remove_polylang_rewrite_rules');
}
function remove_polylang_rewrite_rules() {
// Delete existing rewrite rules from the database
delete_option('rewrite_rules');
// Regenerate the rewrite rules
flush_rewrite_rules();
}
Hello,
Thank you for sharing your solution and for the kind words about Rank Math. We’re glad to hear you resolved the issue and appreciate you contributing the code for others who might face a similar challenge.
If you encounter any further issues or need assistance with anything else, don’t hesitate to reach out. We’re here to help.