Migration from Magento 1 to Magento 2 often leads to a problem to save some categories on the backend. There appears this unavoidable error “URL key for specified store already exists”. Our team has thoroughly investigated the problem and come to a conclusion there is no unified and reliable solution to thrash out the problem. Even if you managed to remove all duplicated URLs, the error would surface again after another "Save" procedure.
The extension can help you remedy all post-migration defects relating to URLs. Just in one SSH command. As a result of it, you get:
• all URLs unique
• properly regenerated url_rewrite table (Reindex URL Rewrites)
• bug-free Magento 2 with regard to URLs
There are numerous reasons for the error “URL key for specified store already exists”. We can name the most prominent one, which is the fact there must be some overlapping URL keys between products, categories, and CMS Pages. Magento 1 is indulgent to such cases and would solve the dilemma with duplicated URLs by appending [url_key]-1, [url_key]-2, etc. Magento 2, in turn, considers any duplication as an error.
Migration process involves hundreds or even thousands of duplicated URL keys to wander from Magento 1 to Magento 2. This makes the problem totally immense. To make it worse, the problem can't be addressed by just making URL keys unique. The “url_rewrite” table, as well as the “URL Path” attribute, has to be generated anew.
Furthermore, the indexing procedure is usually accompanied by various code issues of Magento 2. We keep this situation under control with the help of the extension. Hence, if you decide to remove the plugin after solving the problem with URLs, the errors will find their way back to your Magento 2 again because there will be nothing to stop them.
How to Use
Install the extension following the instruction.
Enter the console and run the command "
php bin/magento" to make sure the new commands are available:
php bin/magento url-optimization:optimize-all
php bin/magento url-optimization:optimize-all-force
php bin/magento url-optimization:unique-url-keys
php bin/magento url-optimization:generate-url-rewrites*
*A complete optimization effect can be achieved by running just a single command:
php bin/magento url-optimization:optimize-all
The other 3 commands are additional tools for developers mostly. The 'force' command skips forming a MySQL transaction, which might be helpful in case of issues with DB.
The flow of a URL optimization process is displayed in detail in the console and, for convenience, logged in:
Should you have any difficulties you may need help with or any questions, we're always happy to assist (support).
- Utterly addresses the issue with saving of category when “URL key for specified store already exists”
- Capable of making all "URL Keys" unique (works with Products, Categories and CMS Pages in any combination)
- Properly regenerates the "url_rewrite" table
- Fixes a Magento 2 problem with spontaneous duplicating of "URL Path"
- Addresses an issue with the suffix "/" for categories and/or products
CompatibilityMagento Open Source (CE) 2.1.x, 2.2.x, 2.3.x, 2.4.x
Magento Commerce (EE) 2.1.x, 2.2.x, 2.3.x, 2.4.x
We provide comprehensive product support for all the Magento extensions available on this site starting from the moment of your purchasing them. If you need help on the extensions installation or on any issues relating to our products, our dedicated team of proven technical experts is at your service, ready to assist you at any time.
Changelognew feature bugfix
- v.2.3.3 (Sep 7, 2020)
- Added support for Magento 2.4.0.
- v.2.3.2 (Jul 28, 2020)
- Added support for Magento 2.3.5;
- Improved URL generation by stores.
- v.2.3.1 (Dec 20, 2019)
- Added support for Magento 2.3.3.
- v.2.3.0 (Apr 11, 2019)
- Added support for 'Use Categories Path for Product URLs = No';
- Added a new command to force optimization.
- v.2.2.6 (Mar 7, 2019)
- Improved generation for duplicated category URLs.
- v.2.2.5 (Feb 21, 2019)
- Improved URL generation;
- Performance optimization.
- v.2.2.4 (Jan 18, 2019)
- Added support for Magento 2.3.
- v.2.2.3 (Nov 27, 2018)
- Improved duplicate URL key detection method.
- v.2.2.2 (Nov 2, 2018)
- Improved support for CMS pages in multi-store setup.
- v.2.2.1 (Jul 20, 2018)
- Added exception handling when unable to save entity.
- v.2.2.0 (Nov 17, 2017)
- Addressed a fatal error when saving categories without URL Paths and with same URL Keys.
- v.2.1.4 (Oct 24, 2017)
- Added compatibility with Magento Open Source/Commerce 2.2;
- Addressed an issue with saving Configurable products without custom options.
- v.2.1.3 (Sep 7, 2017)
- Addressed an issue with CMS page column name in EE version.
- Addressed an issue with generating url rewrites for products without category.
- v.2.1.2 (Sep 4, 2017)
- General code improvements.
- v.2.1.1 (Aug 22, 2017)
- General code improvements;
- Addressed an issue with DB tables containing prefixes.
- v.2.0.0 (Jun 15, 2017)
- Initial release.