XML Sitemap: How to Create, Optimize and Submit It
XML sitemap guide: what to include, how a valid file looks, how to submit it in Search Console and which mistakes make it useless to Google.
Key takeaways
Hreflang is an annotation that tells Google which version of a page to show a user, based on language and region, when you publish the same content in more than one language. It does not translate your site and it does not lift rankings. It simply links the matching pages together, so a visitor in Bucharest searching in Romanian is not sent to the English version of the page.
The name comes from "language reference." Hreflang is a set of annotations that say: "this is the Romanian version, this is the English version, and that one is for readers in the United States." Google uses them to put the right URL in front of the right user.
The problem is simple. You have a page in Romanian and one in English with closely related content. With no hint, Google decides on its own which one to show, and sometimes it guesses wrong. With the annotations in place, it has an explicit map.
Three things hreflang does not do:
One useful detail from Google's documentation: the language of a page is detected algorithmically from its content. The HTML lang attribute still matters for accessibility and screen readers, but it is not what tells Google the page language. Declare it correctly on every page anyway.
You need hreflang when you have the same pages in several languages or for several regions. Typical cases:
If you see yourself in one of those, keep going; hreflang is one piece of the technical SEO of a multilingual site, next to indexing and URL structure. If you run one Romanian site for Romanian customers, jump to the limits section: there is nothing to configure.
Before writing any code, decide what the addresses look like. Google's documentation compares three main options. URL parameters such as ?lang=en are discouraged because they make segmentation difficult.
| Structure | Example | Advantage | Drawback |
|---|---|---|---|
| Subdirectory | site.ro/en/ | One domain, authority in one place, easy maintenance | Geotargeting is not obvious from the address alone |
| Subdomain | en.site.ro | Clear separation, can be hosted separately | Users recognize the country less easily; double maintenance |
| Country-code domain (ccTLD) | site.de | Strongest geotargeting signal | Expensive, needs separate content and administration |
For most small and midsize businesses in Romania, subdirectories are the practical choice: one domain, one certificate, one sitemap, and domain authority builds in a single place. A ccTLD makes sense when you have separate teams and budgets per country.
Two rules whatever the structure:
Google supports three equivalent methods. Do not mix them without a reason. If they contradict each other, the conflicts are hard to trace.
The most common method for small and midsize sites. Every page contains the full set:
<link rel="alternate" hreflang="ro" href="https://example.ro/servicii/" />
<link rel="alternate" hreflang="en" href="https://example.ro/en/services/" />
<link rel="alternate" hreflang="x-default" href="https://example.ro/servicii/" />The same three lines appear on both language versions. URLs are fully qualified, with the https:// protocol.
Useful for non-HTML files such as PDFs. The server sends a Link header:
Link: <https://example.ro/ghid.pdf>; rel="alternate"; hreflang="ro",
<https://example.ro/en/guide.pdf>; rel="alternate"; hreflang="en"Best for large sites, because you do not load every page with dozens of tags. Each <url> entry lists all variants:
<url>
<loc>https://example.ro/servicii/</loc>
<xhtml:link rel="alternate" hreflang="ro" href="https://example.ro/servicii/"/>
<xhtml:link rel="alternate" hreflang="en" href="https://example.ro/en/services/"/>
</url>The root element must declare the namespace xmlns:xhtml="http://www.w3.org/1999/xhtml". If your sitemap is not in good shape yet, read our XML sitemap guide before adding annotations to it.
| Method | Best for | Watch out for |
|---|---|---|
| HTML head | Small and midsize sites | Adds HTML weight when you have many languages |
| HTTP header | PDFs and other non-HTML files | Requires server configuration |
| XML sitemap | Large sites, many languages | Must be regenerated whenever a URL changes |
This is the order we follow on the technical side of a multilingual site.
lang on the html element of each page (<html lang="ro">, <html lang="en">).The format follows ISO standards: a language code (ISO 639-1, two letters), optionally followed by a region code (ISO 3166-1 alpha-2). The separator is a hyphen.
| Code | Valid? | Explanation |
|---|---|---|
ro | Yes | Romanian, any country |
en | Yes | English, general |
en-US | Yes | English for the United States |
en-GB | Yes | English for the United Kingdom |
ro-RO | Yes | Romanian for Romania (rarely needed) |
x-default | Yes | Fallback version |
GB or UK alone | No | A country code cannot stand alone; also, UK is not the ISO code for the United Kingdom (GB is) |
en-EU | No | "EU" is not a country code |
be for Belgium | No | be is the Belarusian language |
A practical rule: if you do not have different content for regions of the same language, use only the language code. Adding both ro-RO and ro-MD on identical pages just creates complexity.
x-default marks the page used when the user's language matches none of your versions. In practice, point it to your main page or to a language selector. It is recommended, not required, but it removes ambiguity for users in countries you do not cover.
The two mechanisms work together and are the most common source of conflicts. The rule: each language version has a canonical pointing to itself, not to the version in another language.
If the English page canonicalizes to the Romanian one, you are telling Google "the English version is just a duplicate of the Romanian one," so the hreflang annotation becomes pointless or contradictory. The URLs in a hreflang set should also be canonical, indexable and return a 200 status. The full explanation of duplicates and canonicals is in our article on canonical tags and duplicate content, and if a version is removed and redirected, see 301 vs 302 redirects.
This website, succes-seo.ro, has a Romanian version at the root and an English version under /en/. Each Romanian page points to its English counterpart and vice versa, and x-default points to the English version, the fallback for visitors whose language we do not cover. It is exactly the subdirectory model from the table above: one domain, one sitemap, one authority. We do not need region codes because we do not publish different content per country.
Following the same principle, a site with three languages would carry four lines on every page: one for each language (including the current one) plus one x-default.
//example.ro/en/ or /en/ are not valid; write the full URL.en-UK and EU are the classic examples. Check the table above.Combine three checks:
Not every site needs this.
en-US and en-GB are identical, a single en is simpler and enough.lang attribute or the Content-Language header, so keep those correct as well.Hreflang is quiet infrastructure: when it is right, nobody notices; when it is wrong, users land on the wrong language. Apply it in this order:
x-default.If you are launching or repairing a multilingual site and want the technical side checked end to end, our technical SEO service covers exactly these checks. For more reading, browse the blog.
Planning a site for several markets? See our international SEO services for companies entering Romania or selling abroad.
Frequently asked questions
No. Hreflang does not move a page up in the results and it does not add authority. Its job is to help Google pick the right version for the user's language and region, so it swaps which page is shown rather than promoting it. It can reduce cases where a Romanian visitor lands on the English page.
Yes. Annotations can connect URLs on different domains or subdomains, such as a .ro and a .de site. The condition is the same: each page must list the other versions and be listed back by them. With separate domains, also confirm that both are crawlable and indexable.
Do not invent translated versions. The existing page can carry a self-referencing annotation or simply stay out of the hreflang set. If you publish a counterpart in another language later, add reciprocal annotations to both pages at that point. A set pointing to URLs that return a 404 only damages the signal.
Only pages that are indexable and have a real equivalent in another language. Filtered or parameter URLs that canonicalize to a different page do not belong in the set. Put annotations on the canonical URL, page by page, not on every possible parameter combination.
It depends on how quickly Google recrawls the pages in the set: from a few days to a few weeks on small sites. There is no guaranteed timeline. Submit an updated sitemap, check in Search Console that both versions are indexed, and avoid changing URLs during that window.
Related service
Keep reading
XML sitemap guide: what to include, how a valid file looks, how to submit it in Search Console and which mistakes make it useless to Google.
Core Web Vitals explained: the LCP, INP and CLS thresholds, how much they affect rankings, how to measure them correctly and what to fix first.
JavaScript SEO explained: how Google renders pages, which rendering model to choose (SSR, SSG, CSR), common errors and how to test indexing step by step.
Send us your website address and we’ll reply with a free initial analysis and a concrete SEO strategy — no strings attached.