2 Add more tags
| link
source | link

Magento 2 - add custum attribute to urlrewrite programmatically

I am trying to regenerate the urlrewrites on magento 2.3.
They are now created by the pruducts name


but i would like to to add some custom attributes.


to have them unique & to prevent the error:

The value specified in the URL Key field would generate a URL that already exists.

any help would be appreciated!