Magento – Magento 2: URL for key for specified store already exists in categories

categorydatabasemagento2product

We are having a problem in our Magento 2.1.3 shop when we try to save the categories. We are getting the message URL for a key for specified store already exists.

The shop is a migration from a Magento 1 shop and has several root categories and stores. There are in the different root categories with the same name.

Till now we could not really find connections where it gives the error and sometimes it does not give the error.

Is there anyone with experience with this error that knows why this is happening?

Best Answer

This issue happens when the URL rewrite you are trying to create already exists for that store.

For example, if you had 2 categories both named clothing and tried to set the url_key for each to clothing-category Magento wouldn't let you save the 2nd category because the URL example.com/clothing-category is already being used.

It might not necessarily be another category URL rewrite that is conflicting either. If you had a cms page or any other entity already using that URL Magento would show that same error.

Related Topic