elgentos / regenerate-catalog-urls

elgentos/regenerate-catalog-urls

magento2-module Compatibility: 2.4.7-2.4.9 Code Quality: Fail Tests: N/A Security: Pass OSL-3.0, AFL-3.0

Are you the maintainer of elgentos?

Packagento pulls elgentos's Composer packages from the public registry so buyers can find them here.

Claim the namespace to take ownership, publish new releases directly, and start charging for premium versions.

Claim this namespace →

Elgentos Regenerate Catalog URLs

What does it do

This extension adds console commands to be able to regenerate;

  • a product rewrite URL based on its url path;
  • a category rewrite URL based on its url path;
  • a CMS page rewrite URL based on its url path;
  • a category URL path based on its URL key and its parent categories.

Install

Using Composer;

composer require elgentos/regenerate-catalog-urls
php bin/magento setup:upgrade

Or download and copy the src directory into app/code/Elgentos/RegenerateCatalogUrls and run php bin/magento setup:upgrade.

How to use

Usage:
 regenerate:product:url [-s|--store="..."] [pids1] ... [pidsN]
 regenerate:category:url [-s]--store="..."] [-r]--root="..."] [cids1] ... [cidsN]
 regenerate:category:path [-s]--store="..."] [-r]--root="..."] [cids1] ... [cidsN]
 regenerate:cms-page:url [-s]--store="..."] [pids1] ... [pidsN]

Arguments:
 pids                  Products (or Pages) to regenerate
 cids                  Categories to regenerate

Options:
 --store (-s)          Use a specific store (store Id, store code or 'all')
 --root (-r)           Regenerate for root category and its children, ignoring cids. 
 --verbose (-v)        Verbose mode to display the errors. Eg: duplicated product urls
 --help (-h)           Display this help message

Eg:

# Regenerate url for all products and the global store
php bin/magento regenerate:product:url

# Regenerate url for products with id (1, 2, 3, 4) for store 1
php bin/magento regenerate:product:url -s1 1 2 3 4

# Regenerate url for all CMS pages
php bin/magento regenerate:cms-page:url -s all

# Regenerate url for root category 4 and its children for store 1
php bin/magento regenerate:category:url -s1 -r4

FAQ

What's the difference between url_key and url_path?

url_key contains the key, like joust-duffle-bag for the product "Joust Duffle Bag". The url_path is generated by taking the url_key and adding the suffix (which for products is stored in catalog/seo/product_url_suffix and defaults to .html). So the url_path would by default become joust-duffle-bag.html. It also adds the category slugs of the parent categories so the url_path might become bags/joust-duffle-bag.html. However, the use of url_path has been deprecated since early Magento 2.1 versions (see here). If you are running on a recent Magento 2 version, you can safely delete those values by running DELETE FROM catalog_product_entity_varchar WHERE attribute_id = (SELECT attribute_id FROM eav_attribute WHERE attribute_code = 'url_path' AND entity_type_id = (SELECT entity_type_id FROM eav_entity_type WHERE entity_type_code = 'catalog_product')).

URL paths are still used in categories though, so don't remove those.

Why am I getting a 'Duplicated url' warning when running the command?

If you see this error, you have duplicate url_key values (within a store) in catalog_product_entity_varchar. You can use this extension to check those (and you need to fix them manually): baldwin/magento2-module-url-data-integrity-checker.

No changelog yet

The vendor hasn't published a changelog. Tagged releases appear in the Versions tab.

Versions
Version Stability QA Status Compatibility Released
0.4.9 stable Fail Magento 2.4.7-2.4.9 Details 2026-05-24 13:22:26
0.4.8 stable Not tested Not yet tested Details 2026-05-22 12:07:46
0.4.7 stable Not tested Not yet tested Details 2025-08-11 06:21:40
0.4.6 stable Not tested Not yet tested Details 2025-07-16 09:41:51
0.4.5 stable Not tested Not yet tested Details 2024-08-08 13:36:33
0.4.4 stable Not tested Not yet tested Details 2024-07-24 13:49:56
0.4.3 stable Not tested Not yet tested Details 2024-07-10 10:26:04
0.4.2 stable Not tested Not yet tested Details 2024-04-25 10:19:06
0.4.1 stable Not tested Not yet tested Details 2024-04-18 07:33:38
0.4.0 stable Not tested Not yet tested Details 2024-03-18 13:54:10
0.3.7 stable Not tested Not yet tested Details 2023-12-28 21:22:34
0.3.6 stable Not tested Not yet tested Details 2023-12-28 08:49:10
0.3.5 stable Not tested Not yet tested Details 2022-12-14 17:42:11
0.3.4 stable Not tested Not yet tested Details 2022-11-02 19:00:18
0.3.3 stable Not tested Not yet tested Details 2022-04-14 17:37:59
0.3.2 stable Not tested Not yet tested Details 2022-03-19 08:15:47
0.3.1 stable Not tested Not yet tested Details 2022-03-08 14:38:34
0.3.0 stable Not tested Not yet tested Details 2022-02-20 11:43:15
0.2.14 stable Not tested Not yet tested Details 2022-02-19 16:44:34
0.2.13 stable Not tested Not yet tested Details 2022-02-09 15:47:51
0.2.12 stable Not tested Not yet tested Details 2022-02-07 14:28:44
0.2.11 stable Not tested Not yet tested Details 2022-01-28 13:00:09
0.2.10 stable Not tested Not yet tested Details 2021-07-27 10:39:23
0.2.9 stable Not tested Not yet tested Details 2021-07-06 07:13:44
0.2.8 stable Not tested Not yet tested Details 2021-06-29 15:01:10
0.2.7 stable Not tested Not yet tested Details 2021-06-29 07:08:33
0.2.6 stable Not tested Not yet tested Details 2020-09-29 06:23:00
0.2.5 stable Not tested Not yet tested Details 2020-04-08 07:46:06
0.2.4 stable Not tested Not yet tested Details 2019-12-17 13:49:03
0.2.3 stable Not tested Not yet tested Details 2019-12-11 09:28:34
0.2.2 stable Not tested Not yet tested Details 2019-10-21 12:31:17
0.2.1 stable Not tested Not yet tested Details 2019-09-09 07:09:22
0.2.0 stable Not tested Not yet tested Details 2019-05-28 15:00:13
0.1.6 stable Not tested Not yet tested Details 2018-12-18 13:00:37
0.1.5 stable Not tested Not yet tested Details 2018-11-28 10:52:51
0.1.4 stable Not tested Not yet tested Details 2018-10-16 12:04:56
0.1.3 stable Not tested Not yet tested Details 2018-09-11 14:26:37
0.1.2 stable Not tested Not yet tested Details 2018-09-11 12:50:17

Requires 4

Package Constraint
magento/framework ^102.0|^103.0
magento/module-catalog-url-rewrite ^100.3|^100.4
magento/module-url-rewrite ^101.1|^102.0
php ~7.4|~8.0|~8.1|~8.2|~8.3

Requires-dev 2

Package Constraint
mediact/coding-standard-magento2 @stable
mediact/testing-suite ^2.9

Replaces 1

Package Constraint
iazel/module-regen-product-url *

Suggests 2

Package Reason
baldwin/magento2-module-url-data-integrity-checker Magento 2 module which can find potential url related problems in your catalog data
fisheye/module-url-rewrite-optimiser A Magento module that stops URL rewrites with category paths being generated for products when 'Use Categories Path for Product URLs' setting is disabled in config.

Compatibility

Each Magento release line is installed on its supported PHP versions, then the module is built (DI compilation + static-content deploy) and its unit and integration suites are run. The matrix shows the lines and PHP versions the module is confirmed to install and run on. Code-quality results further down (phpstan, phpcs, …) are reported separately and never affect compatibility.

Compatibility matrix (Magento × PHP)
Magento PHP 8.2 PHP 8.3 PHP 8.4 PHP 8.5
2.4.7 Pass Pass
2.4.8 Pass Pass
2.4.9 Pass Pass

Code Quality

Advisory checks against the module's source. Static analysis runs once across the whole module; PHPStan re-runs per Magento + PHP version because resolvable symbols differ between releases. These NEVER affect the Compatibility badge. A phpcs finding can't make a module incompatible.

Static analysis

Coding standards (phpcs), mess detection (phpmd), copy-pasted code (cpd), PHP cross-version compatibility, composer.json validity. Each runs once for the whole module.

Static analysis results
Tool Status Findings Summary
PHPCS Pass 0
PHPMD Warning 4 4 rule violations (NPathComplexity:2, ExcessiveMethodLength:1, CyclomaticComplexity:1)
Cpd Pass 0
Composer validate Info 1 valid; 1 advisory note (composer validate --strict)

PHPStan

Type-checks the module's PHP against a real Magento install at the configured gate level. Re-runs per Magento and PHP version because resolvable symbols differ between releases.

PHPStan results by Magento and PHP version
Magento PHP 8.2 PHP 8.3 PHP 8.4 PHP 8.5
2.4.7 4 4
2.4.8 4 4
2.4.9 4 4

Tests

Unit and integration suites, run for each applicable Magento and PHP version. A test failure speaks to the module's behaviour, not its compatibility with a Magento line, so it is reported here separately and never reddens the compatibility matrix.

Unit tests

Unit tests results by Magento and PHP version
Magento PHP 8.2 PHP 8.3 PHP 8.4 PHP 8.5
2.4.7 N/A N/A
2.4.8 N/A N/A
2.4.9 N/A N/A

Integration tests

Integration tests results by Magento and PHP version
Magento PHP 8.2 PHP 8.3 PHP 8.4 PHP 8.5
2.4.7 N/A N/A
2.4.8 N/A N/A
2.4.9 N/A N/A

Security

Security checks run directly against the module: an audit of its declared dependencies for known vulnerabilities (composer audit) and a scan of its source for malware and web-shell signatures. Each runs once. A malware detection fails the version outright.

Security results
Tool Status Findings Summary
Composer audit Pass 0
Malware scan Pass 0
License
OSL-3.0, AFL-3.0

More from elgentos

View vendor
Make it pay

Turn an existing module into recurring revenue.

If you already maintain a Magento 2 module on GitHub or GitLab, listing it on Packagento takes about five minutes. We mirror your tags, handle distribution signing, and route paid licenses through Stripe Connect, so you can keep shipping the way you already do.