I am using Magento 2.3.2 and I am trying to duplicate one of existing SKU from admin I clicked on save and edit and I am getting the following issue.

The value specified in the URL Key field would generate a URL that already exists.
To resolve this conflict, you can either change the value of the URL Key field (located in the Search Engine Optimization section) to a unique value or change the Request Path fields in all locations listed below:

- all-items/chip-dip-14-3-4.html

- colorwave-serving-pieces/chip-dip-14-3-4.html

- entertain-with-colorwave/chip-dip-14-3-4.html

2 Answers 2


URL Key of the product is made by SKU by default, you can duplicate the SKU but not the URL key so where you are trying to duplicate the SKU try to manually set the URL key of the respected productenter image description here


You need to create simple module to fix this like below


namespace VENDOR\MODULE\CatalogUrlRewrite\Model;

    class ProductUrlPathGenerator extends \Magento\CatalogUrlRewrite\Model\ProductUrlPathGenerator
         * Ignore attribute url_path. Always use url_key instead.
         * @inheritdoc
        public function getUrlPath($product, $category = null)
            $path = $product->getUrlKey()
                ? $this->prepareProductUrlKey($product)
                : $this->prepareProductDefaultUrlKey($product);
            return $category === null
                ? $path
                : $this->categoryUrlPathGenerator->getUrlPath($category) . '/' . $path;


<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <preference for="Magento\CatalogUrlRewrite\Model\ProductUrlPathGenerator"
                type="<VENDOR>\<MODULE>\CatalogUrlRewrite\Model\ProductUrlPathGenerator" />

reference https://github.com/magento/magento2/issues/12412

  • this code is not working same issue is there. Note i checked code is going into rewrite function Commented Sep 13, 2019 at 11:41
  • this code is not working with me. Can anyone have solution to help me?
    – huykon225
    Commented Jul 22, 2020 at 4:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.