olegkoval/magento2-regenerate-url-rewrites
Add into Magento 2 a CLI feature which allow to regenerate a Url Rewrites of products and categories
1.9.0
4.0M downloads/mo
#3038 most downloaded on Packagist
olegkoval/magento2-regenerate_url_rewrites
What this package is like to depend on
Last release 5 days ago
18 Aug 2026
Ships unpredictably
gaps range from 9 days to 2.6 years
Nearly every release is documented
notes for 32 of 32 stable releases
Nothing withdrawn
no release was ever pulled
9 years old
32 releases · first in 2017
4 releases in the last 12 months
see the full history below
Release timeline
32 releases · Sep 2017 to Aug 2026Releases
latest 32-
1.9.018 Aug 2026Release notes
Open source →Added
- new option
--skip-products— skip regenerating associated product URLs when regenerating categories (useful on large catalogs when "Use Category Path for Product URLs" is enabled) - new option
--skip-existing— skip an entity entirely if it already has any url_rewrite for the current store, instead of always deleting + regenerating - new option
--include-not-visible— also regenerate URLs for products with visibility "Not Visible Individually" (e.g. configurable child products), excluded by default since 1.6.2 - new option
--add-sku-to-url— append the product's SKU as a URL segment in generated product Url Rewrites, e.g.screws.html->screws-2244000004.html
Fixed
- guard against writing a blank url_key when Magento's own transliteration can't handle the product/category title (e.g. Arabic/other non-Latin scripts)
Release notes
Open source →Added
- new option
--skip-products— skip regenerating associated product URLs when regenerating categories (useful on large catalogs when "Use Category Path for Product URLs" is enabled) - new option
--skip-existing— skip an entity entirely if it already has any url_rewrite for the current store, instead of always deleting + regenerating - new option
--include-not-visible— also regenerate URLs for products with visibility "Not Visible Individually" (e.g. configurable child products), excluded by default since 1.6.2 - new option
--add-sku-to-url— append the product's SKU as a URL segment in generated product Url Rewrites, e.g.screws.html->screws-2244000004.html
Fixed
- guard against writing a blank url_key when Magento's own transliteration can't handle the product/category title (e.g. Arabic/other non-Latin scripts)
- new option
-
1.8.009 Aug 2026Release notes
Open source →⚠️ Breaking change
url_key regeneration is now opt-in. Previously, url_key was regenerated automatically unless you passed
--no-regen-url-key. That default is now inverted: url_key is not regenerated unless you explicitly pass the new--regen-url-keyoption.The old
--no-regen-url-keyoption is removed entirely (not deprecated) — passing it will now produce an "option does not exist" error. If your scripts/cron jobs relied on the previous default (url_key regenerated automatically), add--regen-url-keyto them before upgrading. (#151)What's Changed
Fixed
- Data loss risk in
saveUrlRewrites(): deleting existing rewrites and inserting new ones now happen in a single transaction, so a failed insert can no longer leave an entity with its rewrites deleted and nothing to replace them. (#137) - Category regeneration now processes every category, top level down to the deepest child, instead of only top-level categories — child categories' own url_key/url_path are now regenerated too, not just their url_rewrite rows. (#153, #166)
- Skip writing a redundant per-store url_key override when the regenerated value is identical to the default-scope value, avoiding unnecessary bloat in the EAV attribute tables. (#92)
Added
- New option
--delete-orphaned-rewrites— deletesurl_rewriterows (for the given--entity-type) whose product/category no longer exists. (#158)
Compatibility
- Magento Open Source 2.4.7 → 2.4.9
- PHP 8.2 → 8.5
Full Changelog: 1.7.3...1.8.0
Release notes
Open source →Changed
- BREAKING: inverted url_key regeneration default — url_key is no longer regenerated automatically; use the new
--regen-url-keyoption to opt in. The old--no-regen-url-keyoption is removed entirely (not deprecated) — update any existing scripts/cron jobs that relied on the previous default. - fixed data loss risk in
saveUrlRewrites(): deleting existing rewrites and inserting new ones now happen in a single transaction, so a failed insert can no longer leave an entity with its rewrites deleted and nothing to replace them - fixed category URL rewrite regeneration to process every category (top level down to the deepest child) instead of only top-level categories, so child categories' own url_key/url_path are regenerated too
- skip writing a redundant per-store url_key override when the regenerated value is identical to the default-scope value
Added
- new option
--delete-orphaned-rewrites— deletes url_rewrite rows (for the given--entity-type) whose product/category no longer exists
- Data loss risk in
-
1.7.309 Aug 2026Release notes
Open source →Fixed
- PHP 8.5 compatibility: replaced the deprecated non-canonical (double) type cast with (float) in the progress bar calculation, eliminating the deprecation notice Magento throws under PHP 8.5. (#183)
- Reindex/cache commands now use the correct PHP executable: replaced a hardcoded php command with PHP_BINARY so reindex/cache calls always run under the same PHP version as the CLI command itself, instead of whatever php happens to resolve to on $PATH. (#161)
- Category regeneration no longer aborts entirely when it hits one broken/orphaned category: exception handling is now scoped per-category (matching the existing per-product behavior), so a single bad entity is skipped instead of stopping the whole batch. (#172)
Changed
- Added a missing type hint and defensive casting in a couple of internal helper methods (PHP 8.x hygiene).
- Declared the minimum supported PHP version (>=8.2) in composer.json.
Compatibility
- Magento Open Source 2.4.7 → 2.4.9
- PHP 8.2 → 8.5
Thanks to @swnsma and @f123248 for reporting and helping diagnose the PHP 8.5 issue.
Release notes
Open source →Changed
- fixed deprecated non-canonical (double) type cast for PHP 8.5 compatibility
- use the current PHP executable (PHP_BINARY) instead of a hardcoded "php" command for reindex/cache calls
- fixed category URL rewrite regeneration stopping entirely when a single broken/orphaned category is encountered
- added missing type hint and defensive casting in a couple of helper methods
- declared minimum supported PHP version (>=8.2) in composer.json
-
1.7.207 Apr 2026Release notes
Open source →This release improves compatibility, hardens query safety, and refines CLI behavior for URL rewrite regeneration.
Changed
- fixed deprecated functionality: ctype_digit()
- improved SQL safety in URL rewrite regeneration queries
- fixed SQL escaping in URL rewrite cleanup logic
- fixed _clearRequestPath() to correctly handle multiple consecutive slashes
- removed dead code from category URL rewrite model
- display validation errors before command failure
- display a completed progress bar for empty product/category collections
- normalized line endings to LF
Release notes
Open source →Changed
- fixed deprecated functionality: ctype_digit()
- improved SQL safety in URL rewrite regeneration queries
- fixed SQL escaping in URL rewrite cleanup logic
- fixed _clearRequestPath() to correctly handle multiple consecutive slashes
- removed dead code from category URL rewrite model
- display validation errors before command failure
- display a completed progress bar for empty product/category collections
- normalized line endings to LF
-
1.7.130 May 2025Release notes
Open source →Adapted for compatibility with PHP 8.4 (deprecated implicitly nullable types).
Release notes
Open source →Changed
- adapted for compatibility with PHP 8.4 (deprecated implicitly nullable types)
-
1.7.017 Apr 2025Release notes
Open source →Adapted for compatibility with Magento 2.4.7-p4.
Adapted the composer.json file to be compatible with Composer 2.Release notes
Open source →Changed
- adapted for compatibility with Magento 2.4.7-p4
- adapted the composer.json file to be compatible with Composer 2
-
1.6.210 Oct 2023Release notes
Open source →Fixed Symfony Command constant issue.
Excluded non visible products from url regeneration.Release notes
Open source →Changed
- fixed Symfony Command constant issue
- exclude non visible products from url regeneration
-
1.6.124 Aug 2023Release notes
Open source →Fixed compatibility with Symfony Console 5 and Magento 2.4.6.
Updated contact email.Release notes
Open source →Changed
- fixed compatibility with Symfony Console 5 and Magento 2.4.6
- updated contact email to Gmail email (my own domain olegkoval.com was stolen)
-
1.6.027 Jan 2021Release notes
Open source →Adapted to Magento 2.3.5.
Fixed incorrect generation when URL suffix is slash.Release notes
Open source →Changed
- adapted to Magento 2.3.5
- fixed incorrect generation when URL suffix is slash
-
1.5.614 Apr 2020Release notes
Open source →Changed
- updated logic of "cleaning" of Url Rewrites and duplications check
-
1.5.502 Apr 2020Release notes
Open source →Changed
- updated logic of Url Rewrite regeneration via category entity
- fixed compilation issue in helper
-
1.5.421 Mar 2020Release notes
Open source →Changed
- fixed issue of non-empty/non-false "request_path" of product entity.
- modified logic of Url Rewrite db table updates
-
1.5.321 Mar 2020Release notes
Open source →Changed
- updated Url Rewrite preparing function
- updated logic of Url Rewrite regeneration via category entity
- updated save logic
-
1.5.218 Mar 2020Release notes
Open source →Changed
- updated logic of Url Rewrite regeneration via category entity
- CLI options logic optimized (for category entity)
-
1.5.108 Mar 2020Release notes
Open source →Changed
- fixed issue of url_key and url rewrites regeneration based on product name value
-
1.5.026 Feb 2020Release notes
Open source →Changed
- revised and restructured code
- modified functional logic of extension
- removed option "--check-use-category-in-product-url"
-
1.4.312 May 2019 -
1.4.204 Apr 2019Release notes
Open source →Added
- new option "--check-use-category-in-product-url"
- info into log about conflicted URL Rewrites
Changed
- fixed logical issues in url_key regeneration
- a fix for category/products rewrites for multistore
- fixed issue of division by zero in progress bar
- update the url_key regeneration behavior to use UrlPathGenerators
- modified logic of displaying console messages (notifications, errors, exceptions...)
-
1.4.122 Feb 2019Release notes
Open source →Changed
- fixed the issue of removing previously added URL rewrites of product when the same URL key exists;
- modified progress bar
-
1.4.010 Feb 2019Release notes
Open source →Added
- new option "--entity-type"
- new option "--products-range"
- new option "--product-id"
- new option "--category-range"
- new option "--category-id"
Changed
- revised and restructured code
- modified logic of url rewrites regeneration
- removed "--clean-url-key"
-
1.3.114 Nov 2018Release notes
Open source →Changed
- fixed issue of empty product URL keys
- fixed double slashes issue
- update category attributes via resource saveAttribute()
- use proxy for CategoryUrlPathGenerator
-
1.3.029 Oct 2018Release notes
Open source →Added
- new option "--no-cache-clean"
- new option "--no-cache-flush"
- new option "--no-progress"
- new option "--no-clean-url-key"
Changed
- optimized code
- modified logic of url rewrites regeneration
- fixed issue of store filter in a category collection
-
1.2.303 Oct 2018Release notes
Open source →Added
- display additional debug information for "URL key for specified store already exists" error
Changed
- modified logic of url rewrites regeneration
-
1.2.202 Oct 2018 -
1.2.125 Sep 2018 -
1.2.024 Sep 2018Release notes
Open source →Changed
- added proxies to CLI commands
- modified logic of url rewrites regeneration
- updated a composer file
- fixed issue of a compatibility with new Magento Commerce versions
-
1.1.110 Sep 2018 -
1.0.626 Jul 2018Release notes
Open source →Added
- new option to run URL rewrite generation without running full reindex
Changed
- update help notice to show INPUT_KEY_SAVE_REWRITES_HISTORY and INPUT_KEY_NO_REINDEX
-
1.0.512 May 2018Release notes
Open source →Added
- new option to save current URL rewrites
Changed
- improve the store ID arguments workflow
-
1.0.413 Nov 2017 -
1.0.308 Nov 2017 -
1.0.029 Sep 2017