PackageTrack
Sign in Get early access

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 2026
2018 2019 2020 2021 2022 2023 2024 2025 2026
Release Pre-release

Releases

latest 32
  1. 1.9.0 18 Aug 2026
    Release notes

    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)
    Open source →
    Release notes

    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)
    Open source →
  2. 1.8.0 09 Aug 2026
    Release notes

    ⚠️ 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-key option.

    The old --no-regen-url-key option 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-key to 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 — deletes url_rewrite rows (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

    Open source →
    Release notes

    Changed

    • BREAKING: inverted url_key regeneration default — url_key is no longer regenerated automatically; use the new --regen-url-key option to opt in. The old --no-regen-url-key option 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
    Open source →
  3. 1.7.3 09 Aug 2026
    Release notes

    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.

    Open source →
    Release notes

    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
    Open source →
  4. 1.7.2 07 Apr 2026
    Release notes

    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
    Open source →
    Release notes

    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
    Open source →
  5. 1.7.1 30 May 2025
    Release notes

    Adapted for compatibility with PHP 8.4 (deprecated implicitly nullable types).

    Open source →
    Release notes

    Changed

    • adapted for compatibility with PHP 8.4 (deprecated implicitly nullable types)
    Open source →
  6. 1.7.0 17 Apr 2025
    Release notes

    Adapted for compatibility with Magento 2.4.7-p4.
    Adapted the composer.json file to be compatible with Composer 2.

    Open source →
    Release notes

    Changed

    • adapted for compatibility with Magento 2.4.7-p4
    • adapted the composer.json file to be compatible with Composer 2
    Open source →
  7. 1.6.2 10 Oct 2023
    Release notes

    Fixed Symfony Command constant issue.
    Excluded non visible products from url regeneration.

    Open source →
    Release notes

    Changed

    • fixed Symfony Command constant issue
    • exclude non visible products from url regeneration
    Open source →
  8. 1.6.1 24 Aug 2023
    Release notes

    Fixed compatibility with Symfony Console 5 and Magento 2.4.6.
    Updated contact email.

    Open source →
    Release notes

    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)
    Open source →
  9. 1.6.0 27 Jan 2021
    Release notes

    Adapted to Magento 2.3.5.
    Fixed incorrect generation when URL suffix is slash.

    Open source →
    Release notes

    Changed

    • adapted to Magento 2.3.5
    • fixed incorrect generation when URL suffix is slash
    Open source →
  10. 1.5.6 14 Apr 2020
    Release notes

    Updated logic of "cleaning" of Url Rewrites and duplications check.

    Open source →
    Release notes

    Changed

    • updated logic of "cleaning" of Url Rewrites and duplications check
    Open source →
  11. 1.5.5 02 Apr 2020
    Release notes

    Changed

    • updated logic of Url Rewrite regeneration via category entity
    • fixed compilation issue in helper
    Open source →
  12. 1.5.4 21 Mar 2020
    Release notes

    Changed

    • fixed issue of non-empty/non-false "request_path" of product entity.
    • modified logic of Url Rewrite db table updates
    Open source →
  13. 1.5.3 21 Mar 2020
    Release notes

    Changed

    • updated Url Rewrite preparing function
    • updated logic of Url Rewrite regeneration via category entity
    • updated save logic
    Open source →
  14. 1.5.2 18 Mar 2020
    Release notes

    Changed

    • updated logic of Url Rewrite regeneration via category entity
    • CLI options logic optimized (for category entity)
    Open source →
  15. 1.5.1 08 Mar 2020
    Release notes

    Changed

    • fixed issue of url_key and url rewrites regeneration based on product name value
    Open source →
  16. 1.5.0 26 Feb 2020
    Release notes

    Changed

    • revised and restructured code
    • modified functional logic of extension
    • removed option "--check-use-category-in-product-url"
    Open source →
  17. 1.4.3 12 May 2019
    Release notes

    Added

    • new option "no-regen-url-key"

    Changed

    • fixed a "typo" issue
    Open source →
  18. 1.4.2 04 Apr 2019
    Release notes

    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...)
    Open source →
  19. 1.4.1 22 Feb 2019
    Release notes

    Changed

    • fixed the issue of removing previously added URL rewrites of product when the same URL key exists;
    • modified progress bar
    Open source →
  20. 1.4.0 10 Feb 2019
    Release notes

    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"
    Open source →
  21. 1.3.1 14 Nov 2018
    Release notes

    Changed

    • fixed issue of empty product URL keys
    • fixed double slashes issue
    • update category attributes via resource saveAttribute()
    • use proxy for CategoryUrlPathGenerator
    Open source →
  22. 1.3.0 29 Oct 2018
    Release notes

    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
    Open source →
  23. 1.2.3 03 Oct 2018
    Release notes

    Added

    • display additional debug information for "URL key for specified store already exists" error

    Changed

    • modified logic of url rewrites regeneration
    Open source →
  24. 1.2.2 02 Oct 2018
    Release notes

    Changed

    • fixed setStoreId() on null error
    Open source →
  25. 1.2.1 25 Sep 2018
    Release notes

    Changed

    • fixed compilation issues
    Open source →
  26. 1.2.0 24 Sep 2018
    Release notes

    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
    Open source →
  27. 1.1.1 10 Sep 2018
    Release notes

    Changed

    • fix composer file format issue
    Open source →
  28. 1.0.6 26 Jul 2018
    Release notes

    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
    Open source →
  29. 1.0.5 12 May 2018
    Release notes

    Added

    • new option to save current URL rewrites

    Changed

    • improve the store ID arguments workflow
    Open source →
  30. 1.0.4 13 Nov 2017
    Release notes

    Added

    • additional checks of storeId argument
    Open source →
  31. 1.0.3 08 Nov 2017
    Release notes

    Added

    • check if area code is set
    Open source →
  32. 1.0.0 29 Sep 2017
    Release notes

    Release of Magento 2 "Regenerate Url Rewrites" extension

    Open source →

Every package, every release, already written down.

The archive is open and free. Watching your own project is what we are building next.

Browse the archive