Log in
Model

ProductUrlPathGenerator

Magento\CatalogUrlRewrite\Model\ProductUrlPathGenerator

What it does

This class generates URL paths and URL keys for product pages in Magento 2.

Developers use it when creating or updating product URLs, generating SEO-friendly slugs, or building URL rewrites for products with or without categories.

It handles URL suffixes (.html), canonical paths, and fallback logic for URL key generation from product names.

Public Methods

  • getUrlPath()
  • getUrlPathWithSuffix()
  • getCanonicalUrlPath()
  • getUrlKey()