cancel
Showing results for 
Search instead for 
Did you mean: 

How to prevent autogenerated category and product rewrite urls

How to prevent autogenerated category and product rewrite urls

When I'm importing products or creating categories magento always automatically generates rewrite urls.

These rewrites are listet at Admin Backend -> Marketing -> URL Rewrites.

The category url I want:
www.example.com/store-view/category-name

What Magento 2 gives me after its autogenerated url rewrite:
www.example.com/store-view//catalog/category/view/s/category-name/id/4/

I know that I can get rid of the redirect by deleting it at Admin Backend -> Marketing -> URL Rewrites. However, I have hunderts of catgeories and thousands of products and there is no batch delete and I don't want to edit the database because this is unsafe and I would have to do it after each product import.

My questions are:
1. Why is Magento generating such wired urls?
2. How can I prevent autogenerated rewrite urls? Can I do this via config.xml or by writing a plugin (At this point of time I don't know the method that is responsible for autogenerating rewrite urls)?

2 REPLIES 2

Re: How to prevent autogenerated category and product rewrite urls

Hi @jens_sch,

 

Is this the problem you've described? https://github.com/magento/magento2/issues/5863

Re: How to prevent autogenerated category and product rewrite urls

Yes, that's it. Thank you for providing the link. It seems it's a bug and there is no solution available.