# elgentos/regenerate-catalog-urls

`composer require elgentos/regenerate-catalog-urls`

Canonical URL: https://packagento.com/elgentos/regenerate-catalog-urls

## At a glance

- **Vendor**: elgentos (https://packagento.com/elgentos.md)
- **Latest version**: 0.4.9 — released 2026-05-24
- **Pricing**: Free
- **Package type**: Magento 2 module
- **Status**: active, accepting new buyers

## Installation

Packagento is licence-gated, so even free packages need a licence on a project before Composer can resolve them.

1. **Sign in or create an account** at https://packagento.com/customer/account/.

2. **Add the package to your account.** Open https://packagento.com/elgentos/regenerate-catalog-urls and complete the free checkout. A licence is minted automatically.

3. **Create or pick a project, then activate the licence on it.**
   - Projects represent the Magento installs you deploy to. Manage them at https://packagento.com/projects/.
   - Activate the new licence on the project you'll deploy this package to. Activation is what generates the Composer credentials scoped to that project.

4. **Add the project credentials to your Magento codebase.**

   Grab the project's public + private key from https://packagento.com/projects/ (open the project, then its Credentials tab), and add them to `auth.json`:

   ```json
   {
     "http-basic": {
       "packagento.com": {
         "username": "ppk_live_...",
         "password": "psk_live_..."
       }
     }
   }
   ```

   Add the Packagento Composer repository to `composer.json`:

   ```json
   {
     "repositories": [
       { "type": "composer", "url": "https://packagento.com" }
     ]
   }
   ```

5. **Install and apply.**

   ```bash
   composer require elgentos/regenerate-catalog-urls:*
   bin/magento setup:upgrade
   bin/magento setup:di:compile
   bin/magento cache:flush
   ```

## README

### 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;

```sh
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:
```sh
## 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](https://github.com/magento/magento2/issues/9113)). 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](https://github.com/baldwin-agency/magento2-module-url-data-integrity-checker).

## Recent Versions

| Version | Released |
|---|---|
| 0.4.9 | 2026-05-24 |
| 0.4.8 | 2026-05-22 |
| 0.4.7 | 2025-08-11 |
| 0.4.6 | 2025-07-16 |
| 0.4.5 | 2024-08-08 |
| 0.4.4 | 2024-07-24 |
| 0.4.3 | 2024-07-10 |
| 0.4.2 | 2024-04-25 |
| 0.4.1 | 2024-04-18 |
| 0.4.0 | 2024-03-18 |

Showing 10 of 38 versions. Full release history on https://packagento.com/elgentos/regenerate-catalog-urls.

## Dependencies

### Require

| 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 |

### Require (dev)

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

### Replace

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

### Suggest

| Package | Constraint |
|---|---|
| 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. |

## Quality

Latest release (0.4.9) fails the Packagento QA pipeline. Verdicts below are per-cell (Magento line × PHP version) for the matrixed tools, and run-once for the static / security tiers.


### Compatibility

Each Magento line is installed on its supported PHP versions, then the module is built (DI compile + static-content deploy). Cells show passed / failed / untested; staircase gaps render as `–`.

| 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. Never affect the Compatibility verdict — 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.

| 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 against a real Magento install. Re-runs per Magento + PHP version because resolvable symbols differ between releases.

| 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 per Magento + PHP cell. Test failures speak to the module's behaviour, not its compatibility with a line, so they're reported here separately.

#### Unit Tests

| 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

| 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

Dependency-advisory audit (composer audit) plus a source malware scan. A malware detection fails the version outright.

| Tool | Status | Findings | Summary |
|---|---|---|---|
| Composer audit | Pass | 0 |  |
| Malware scan | Pass | 0 |  |

## Licence and pricing

Free. A licence is still minted on checkout and bound to your project for Composer access — no payment step.

Refundable within 14 days of first purchase via https://packagento.com/account/refunds/.

## Install via Claude Code or any MCP client

The Packagento MCP server can run the licence + project + Composer steps above in one tool call:

```
purchase_and_install_packages(
  composer_names=["elgentos/regenerate-catalog-urls"],
  project_id="proj_xxx"
)
```

This handles cart, checkout, licence minting, project activation, and writes auth.json credentials. Connect a client with `claude mcp add packagento https://mcp.packagento.com`. Full setup at https://packagento.com/docs/mcp-setup.

## Vendor

elgentos is a Magento 2 vendor on Packagento. See https://packagento.com/elgentos.md for their full catalogue.

