How to Solve The Magento 2 “URL Key for Specified Store Already Exists” Error

- E-Commerce, Magento 2

 

magento 2 url key for specified store already exists error

When creating or importing categories and products some may encounter the Magento 2 “URL key for specified store already exists” error message. It may be the URL rewrites, database issues, or other things not considered.

Anyways, if there is an error there will also be a solution. In this article, we talk about how to solve the Magento 2 “URL key for specified store already exists” error when importing products and categories to your store.

You will learn when the error occurs, exploring specific conditions that cause it. This article mentions three different cases that usually lead to the “URL key for specified store already exists.” Next, we focus on the most frequent reason – duplicate URLs. The value specified in the URL key field would generate a URL that already exists in Magento 2. You will find out how to get rid of duplicate URLs when importing data to Magento 2. The article provides separate examples for products and categories. After that, we emphasize other features related to the Improved Import & Export extension – the solution that we use to address the “URL key for specified store already exists” issue.

Magento 2 “URL key for specified store already exists” error: key factors

The Magento 2 “URL key for specified store already exists” error can be encountered when creating and managing products or categories in the following cases:

  1. Incorrect URL rewrites in the table’s url_rewrite column. In this case, the value specified in the URL key field would generate a URL that already exists in Magento 2. You just need to proceed to the CSV you are trying to import, locate the url_rewrite column, and double-check its values.
  2. Wrong attribute ID in the “catalog_category_entity_varchar” table. Make sure the correct attribute ID is specified in the “catalog_category_entity_varchar” table for url_key and url_path.
  3. A category or a product with the same URL. This issue is similar to the first one. In this case, you try to import a product or a category with the same URL that already exists. Although the URL is not incorrect, you need to replace it or alter it. 

Below, we focus on solving the error when importing products or categories to your Magento 2 store. You can skip all these errors when importing categories and products with the Improved Import and Export extension.

How to get rid of duplicate URLs

Improved Import and Export extension introduces jobs to import and export data automatically. Each job offers tons of different features and useful time-savers. They vary a lot depending on the selected entity. However, products and categories come with the Generate Unique Url if Duplicate setting. If you enable it, the value specified in the URL key field will never generate a URL that already exists on your Magento 2 website.

solve magento 2 url key for specified store already exists error by generating unique urls for products and categories

How does this setting work? Well, if Generate Unique Url if Duplicate is enabled and you import a product or category with a URL  that already exists, the extension either creates a new URL using product attributes or increments this URL if you import categories. Let’s see.

Solving the Magento 2 “URL key for specified store already exists” error for products

When you import products with the same URLs, the extension recomposes the URL of the second product on the following pattern:

Product name + product SKU + increment value (1+)

For example, you want to import a Magento 2 product with a URL that already exists and the following parameters:

  • Name = New Product
  • SKU = test

Then, since the product’s URL is a duplicate, the extension generates a new URL for it that looks like this:

New-product-test-1

Solving the Magento 2 “URL key for specified store already exists” error for categories

When you import categories with the same URLs, the extension increments the duplicate using the following pattern:

url_key + 1

If such a URL already exists for a category on your Magento 2 website, the Improved Import & Export extension adds “1” to avoid the import error.

For example, you need to import a Magento 2 category with a URL key test_category. However, this URL key already exists. The extension increments this URL as follows:

test_category1

That’s it, with the Improved Import and Export extension, you don’t have to worry about the Magento 2 “URL key for specified store already exists” error. Just turn on the corresponding feature in your import profile. You can find more information on import processes here: Improved Import & Export Manual. Also, follow this link to get the extension:

Get Improved Import Magento 2 Extension

Magento 2 Improved Import & Export FAQ

Since we use the Improved Import & Export extension to solve the ‘Specified URL key already exists’ error that occurs when you import data to Magento 2, it is necessary to say a few more words about the plugin. Let’s see what else the module does. 

What other import and export errors does the extension solve?

Since the Improved Import & Export extension is a standalone solution that doesn’t rely on the default data transfer mechanisms of Magento 2, it also addresses most of the issues associated with the platform’s built-in tools. If any error occurs, feel free to contact our support and ask for a resolution.

What are the extension’s features that set it apart from other similar tools and native data transfer instruments?

The Improved Import & Export Magento 2 module offers a bunch of features that set it apart from other similar tools and native data transfer instruments of Magento 2. First of all, it lets you automate data transfers. The module relies on cron to enable schedules. At the same time, you can create rules that launch import and export processes when specific conditions are met.
Secondly, there is a strong mapping interface built into the tool. The Improved Import & Export extension lets you apply presets to modify data during import processes automatically. It means that the external output is transformed according to the platform’s requirements. Alternatively, you can map attributes and their values automatically for both import and export processes.
Thirdly, you get the ability to use numerous file formats and sources. The plugin works with CSV, XML, XLSX, ODB, and JSON files. You can transfer them in a compressed state as ZIP and TAR archives from FTP/SFTP, Dropbox, URL, or upload directly. Alternatively, Google Sheets import and API connections are at your service.
Note that these are only the core features of the Improved Import & Export Magento 2 extension. Visit its page on our website to see more useful functionalities associated with the module.

What is the extension’s role in daily Magento 2 processes?

As we’ve already mentioned above, the Improved Import & Export extension lets you address numerous issues, including the ‘Specified URL key already exists’ error. At the same time, it lets you automate data transfers, such as product and stock updates, order synchronizations, customer data transfers, etc.

Improved Import & Export transfers products and categories between Magento 2 and other systems. What are other entities supported?

The Improved Import & Export module can move all core entities introduced in Magento 2. In addition to all product types and categories, it also works with product attributes and attribute sets, advanced pricing, customers, orders, tracking codes, static blocks, and other store page elements, documents, price rules for both catalog and cart, reviews from your product pages, gift cards, page hierarchy, search terms and synonyms, URL rewrites, newsletter subscribers, and even MSI data related to warehouses and sources. In addition, you can import and export various B2B entities, such as companies and roles used in them, shared catalogs, requisition lists, negotiable quotes, etc. If you need to transfer an entity that is not supported at the moment, contact our support and ask our specialists to add the missing functionality.

Is it possible to import data from other systems and e-commerce platforms to Magento 2?

Yes, as we’ve already mentioned, you can freely import any external output to Magento 2 due to the robust mapping functionality of the Improved Import & Export extension. It lets you inform the system on how to refer to an attribute/column from the imported file from the perspective of the corresponding Magento 2 attribute. Numerous file formats that the module supports also simplify integrations. Besides, the extension lets you create API connections, transferring data between the two points directly.

Is it possible to automate data transfers with the help of the extension?

Since the Improved Import & Export supports cron, you can automate data transfers with the help of schedules. Also, it is possible to create rules and triggers that launch import and export processes when specific conditions are met.

How fast is the Magento 2 extension?

Since the speed of the Improved Import & Export tool depends on numerous factors, we cannot provide a single answer. On average, it moves about 3k entities into the system within a minute. However, different file formats, server configurations, and the necessity to transfer images may slow down import processes.

What additional value is hidden behind the Improved Import & Export?

With the Improved Import & Export extension, you also get several free add-ons. The module is equipped with the free Product Feeds solution that lets you transfer products from Magento 2 straight to eBay, Facebook, and Amazon. Besides, you can leverage the free MSI add-on that extends support for warehouses, automating various related processes.

Is it possible to customize Improved Import & Export?

Since the extension’s code is open, you can freely customize the tool. However, applying changes to its standard functionality is usually a tricky task for people who have never worked with the extension. To avoid various headaches and issues, ask our specialists to implement customizations for you. Since we know every corner of our plugin, it won’t take much time and effort to do that. And we will apply changes much faster than any third-party developers.

Do you offer a refund period for Improved Import & Export?

The Improved Import & Export extension comes with a 30-day money-back guarantee. However, you can always ask our specialists about things that you don’t like about the module. Perhaps, you didn’t apply the Improved Import & Export Magento 2 extension to your business case properly. Therefore, ask us for help before applying for a refund.

Is it safe to use the extension?

The Improved Import & Export extension is totally secure. Firstly, the module is worth your attention due to our team of Magento-certified specialists. Only the best specialists sweat for the module. Secondly, the Improved Import & Export plugin is available on the Magento Marketplace. It means that it has successfully passed numerous security checks. If you have any concerns, feel free to contact our support and share them with us.

Final Words

As you can see, the Improved Import & Export extension not only helps you solve the Magento 2 “URL Key for Specified Store Already Exists” error but also offers tons of useful features and improvements to the platform’s standard data import. You can automate your data transfers, use mapping for third-party data, import and export numerous entities unsupported in the default importer, and rely on import and export sources, such as Google Sheets or Dropbox. Follow this link for more import and export opportunities:

Get Improved Import Magento 2 Extension