Hello,
Thanks for contacting us, and sorry for any inconvenience that might have been caused due to that.
You can try redirecting the duplicate URL to the final URL in this case to avoid duplication issue on GSC.
You may use our redirection feature to do that:
https://rankmath.com/kb/how-to-create-a-redirection/
Hope that helps, and please do not hesitate to let us know if you need our assistance with anything else.
Thank you.
That’s a good solution for existing links, but I’m looking to prevent the problem to appear in future and find a better solution.
I’ve disabled the option “strip category base” but nothing changed for existing pages.
Should I specify the category when setting the permalink of a page? “%category%” does not work in that field.
Hello,
Adding %category% to the permalink settings should work in this case. If that doesn’t work, either you’ll need to create redirection for each category manually or by code customization.
Hope that helps, and please do not hesitate to let us know if you need our assistance with anything else.
Thank you.
As I said “%category%” does not work for the permalink.

Hello,
Instead of setting %category% in Rank Math permalink settings, you should set it to WordPress permalink settings at WordPress Dashboard > Settings > Permalinks, and create a custom structure like below:

Let us know how it goes. Looking forward to helping you.
Thank you.
Changing the structure of the totality of the links in an already established website, is a practice that you do not recommend in your courses.
The main problem is still here: when I create a new page that page can be reached through 2 different links (with and without the category in the URL) and this cause a duplicated page + canonical url errors on google. Is this common with rankmath? Does a fix or a tutorial exist? I refuse to think that a 301 redirect have to be a common practice.
Hello,
Yes, you should not change permalinks unless it is absolutely necessary.
The way you are trying to use %category% variable will not work when you add it to the permalink through Rank Math. The standard permalink settings are following when you see a preview in the Rank Math SEO Meta box and apart from changing the slug, there is not much you can change in the URL of the page.
The strip category base option only removes the /category/ part from the URL and that too for category archives like domain.com/category/gaming-headsets/ etc.. The option will convert it to domain.com/gaming-headsets/
As long as the proper canonical tag is used – you should not worry about the content being flagged as duplicate as Google will know where the original piece is and which one to rank.
Hope that helps.
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.