Log in
Model

AdaptUrlRewritesToVisibilityAttribute

Magento\CatalogUrlRewrite\Model\Products\AdaptUrlRewritesToVisibilityAttribute

What it does

This class manages URL rewrites for products when their visibility attribute changes.

It deletes URL rewrites when products are set to 'Not Visible' and creates/updates them when visibility is changed to any other value.

Developers would use this when programmatically updating product visibility in bulk to ensure the storefront URLs are correctly updated or removed.

Public Methods

  • execute()