Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Miranda Weathers 5 posts 45 karma points
    Sep 12, 2023 @ 13:52
    Miranda Weathers
    0

    HTML tags in XML sitemap when inspecting elements

    My Umbraco 8 XML sitemap is displaying html tags and I don't know why! Content Type header shows it's a text/xml document, but when inspecting elements the page includes html markup. The sitemap is using a cshtml template as directed by Umbraco documentation on creating an XML sitemap, with Layout = "null". What could be the issue here? And is it an issue to begin with? This is for SEO purposes, not for people to be reading, so it needs to be a proper XML sitemap.

    Screenshot of sitemap with dev tools network tab open, showing the content type header is text/xml

    screenshot of sitemap with dev tools elements tag open, showing the file contains html tags

    screenshot of xml view file

  • Miranda Weathers 5 posts 45 karma points
    Sep 12, 2023 @ 14:35
    Miranda Weathers
    100

    Turns out it's not actually HTML. I think the browser does it? When viewing page source, it is indeed XML, but when inspecting the elements, it does contain HTML

Please Sign in or register to post replies

Write your reply to:

Draft