getgrav / grav-plugin-sitemap

Grav Sitemap Plugin
https://getgrav.org
MIT License
42 stars 42 forks source link

canonical tag for sitemap.xml #108

Closed ChristianaHoJo closed 1 year ago

ChristianaHoJo commented 1 year ago

Hi, is it possible to set sitemap.xml as canonical? Google Conversion crawled sitemap.xml with URL params and complaines dublicate content. I look forward to an answer, Christiana

Karmalakas commented 1 year ago

IIRC, canonical link tag should be set on the page itself if you have multiple URLs for that page, and not in the sitemap. Sitemap itself does not support canonical URLs

ChristianaHoJo commented 1 year ago

Hi @Karmalakas, the canonical tags for pages are set on the pages themselves. Google has found a sitemap link with params

/sitemap.xml?213ddf9382cb3d7ffb633e793782271d=txxauhotljhbrj

Can't find out where that URL came from. So I wonder If I can set an canonical marker to the xml file but didn't found a good solution.

Karmalakas commented 1 year ago

This doesn't look like something generated by GRAV. Check your setup on Google account if you maybe have such link defined somewhere there. Otherwise my best guess would be, that Google found this link somewhere in the wild.

I guess you could add a permanent redirect in .htaccess directly

ChristianaHoJo commented 1 year ago

Yes, an redirect will be a short fix. I already thought that you can't store a canonical attribute in xml.files as a general solution. Thank you for your answer.