Description
Preconditions (*)
Magento Commerce 2.4.3-p1, fresh installation and my production Site
Missing 3th subcategory in sitemap. It generates a lot of trouble with SEO Canonical tag shows on -> https://www.example.com/Subcategory1/Subcategory2/Subcategory3/Product1 and Sitemap generates https://www.example.com/Subcategory1/Subcategory2/Product1
Edit:
I don't know if that has anything to do with it, but if the URL rewrite ID plays a role. they are created incorrectly from the order. I am trying to explain
id 1 https://www.example.com/Product1
id 2 https://www.example.com/Subcategory1/Subcategory2/Subcategory3/Product1
id 3 https://www.example.com/Subcategory1/Product1
id 4 https://www.example.com/Subcategory1/Subcategory2/Product1 <--It looks like the last ID are taken to generate the Sitemap
Ok it have to do with the url-rewrite ID i tryed by my self. Modify Product1 add it to Subcategory1 save, add to Subcategory2 save, add to Subcatagory3 save. The result is right order of url-rewrite ID and Sitmap works as expected and shows https://www.example.com/Subcategory1/Subcategory2/Subcategory3/Product1
It dosnt work if you select only the Subcategory3 or all Subcategories at the same time for the Product1
How can i fix that i got a lot of warning in Search console Duplicate - Submitted URL not set as canonical for this sitmap and i cannot fix 100 or more products by hand as i descriped earlyer.
Steps to reproduce (*)
Stores->Configuraton-Catalog->Catalog->Search Engine optimization
-
Set Use Categories Path for Product URLs -> Yes
-
Catalog-->Categories -> Create Three categories each as Subcategory from the last one.
Default Categorie
|>Subcategory1
|-->Subcategory2
|_--->Subcategory3 -
Catalog-->Products -> Create a product and name it Product1, set the Product Category to Subcategory3
-
Marketing->Site Map -> Create a new sitemap and generate it
Expected result (*)
https://www.example.com/Subcategory1/Subcategory2/Subcategory3/Product1Actual result (*)
https://www.eample.com/Subcategory1/Subcategory2/Product1Additional Information:
2.4-develop behavior: Category path is not included for product url in sitemap no matter even if all categories are assigned to the product:
Please provide Severity assessment for the Issue as Reporter. This information will help during Confirmation and Issue triage processes.
- Severity: S0 - Affects critical data or functionality and leaves users without workaround.