Forum Moderators: goodroi

Message Too Old, No Replies

Sitemap Hreflang Not In Source Code But In Dev Tools Inspect

         

JinKazama

9:37 am on Jul 15, 2025 (gmt 0)

10+ Year Member



Our site is implementing hreflang through XML sitemaps.

If I open any of the sitemaps and view source in the browser, I cannot see any of the hreflang implementation, only the list of pages for that locale

But, if i use dev tools to inspect the sitemap, I can find the full hreflang markup

Is this a problem? Will google and bing still be able to see the hreflang markup in the sitemaps if it's not in the initial page code?

tangor

11:34 am on Jul 15, 2025 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



@JinKazama ... Welcome to Webmasterworld!

Is there a specific reason why hreflang is NOT on every page of the site?

Sitemap is not even required, thus has ZERO impact on "site wide declarations" intended for EACH PAGE.

not2easy

11:46 am on Jul 15, 2025 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



That is acceptable markup, to only show the hreflang in a sitemap, but if there are separate language pages you may also need canonical metadata or sitemaps. Their instructions are here: https://developers.google.com/search/docs/specialty/international/localized-versions#sitemap and they have a troubleshooting section there to help you find any possible errors.

(the link contains a # so it would need to be copied and pasted to your browser's address bar)

JinKazama

1:16 pm on Jul 15, 2025 (gmt 0)

10+ Year Member



Thanks, the hreflang code looks correct, with links to each variant including a self-referencing link, plus each page has a self-referencing canonical tag

My question is more around whether search engines can properly crawl this information as it's not found whhen I look at the initial source code, but IS found when I inspect the page with dev tools

not2easy

2:14 pm on Jul 15, 2025 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



If you inspect a given URL using GSC, does that indicate the hreflang properties? What you see could possibly be based on your browser's language preference.