5

I am getting Sitemap XML using mydomain/sitemap.xml but because of a tag, it is not correctly getting rendered in all browsers. Is there a way to configure/remove the following particular tag from sitemap.xml

Need to remove this:

xhtml:link rel="alternate" hreflang="en" href="https://mydomain.com/en

enter image description here

1
  • Likely not worth the effort to change this. The goal is to have a file compatible with search engines. Jun 20, 2019 at 14:39

1 Answer 1

8

Yes, you can. But it's not configurable.

You need to override SitemapGenerator located in Sitecore.XA.Feature.SiteMetadata library. Most of the things are marked there as protected virtual so you shouldn't have problems with achieving what you want in your implementation.

At the end just replace SXA implementation with your one in the DI container. This class is registered in the Sitecore.XA.Feature.SiteMetadata.config configuration file (section <services>) but you can replace it in the code as well.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.