How do you combine Sitemap extensions?

ProcrustesPR

To combine Sitemap extensions, first identify which extensions you need, declare their namespaces in the root urlset element, and then follow each extension’s documentation to add tags to the corresponding url elements. Google’s documentation states that extensions must appear after loc, but their order relative to one another does not matter. Combining extensions can significantly increase file size, so check that the result still meets Sitemap size limits. When checking the format, look beyond element order: verify the namespaces, make sure the tags are under the correct URL, and check that each extension’s implementation requirements are met.

ProcrustesPRProcrustesPRHow Long Does It Take to Evaluate SEO Results?

First, identify which extensions your content needs

A single page can use multiple extensions; you do not have to choose just one type of information from images, news, videos, or language versions. The documentation gives the example of a news article that contains both embedded images and videos. If the page also has localized versions, you can add hreflang annotations as well.

  • image: Used for image extensions.
  • news: Used for news extensions.
  • video: Used for video extensions.
  • xhtml: Used for hreflang annotations.

Before combining extensions, list the ones you actually intend to use and consult the corresponding documentation. Do not copy every tag from the example into every url element.

Declare namespaces, then add tags to the corresponding url elements

Declare a namespace for each type of extension you use, using xmlns attributes on urlset. For example:

  • News: Use xmlns:news with the value http://www.google.com/schemas/sitemap-news/0.9.
  • Video: Use xmlns:video with the value http://www.google.com/schemas/sitemap-video/1.1.
  • hreflang: Use xmlns:xhtml with the value http://www.w3.org/1999/xhtml.

Once the namespaces are declared, add content according to each extension’s documentation. For example, for a news article that includes video and has localized versions, use loc within the corresponding url element to specify the page’s URL, then add tags such as news:news, video:video, and xhtml:link. The information must go in the corresponding url element; simply adding namespace declarations at the beginning of the file is not enough.

Check structure and size, and place extensions after loc

  • Check declarations: Make sure every extension in use has a corresponding namespace.
  • Check content: Verify tags and fields against each extension’s documentation; do not treat the combined example as a complete specification.
  • Check placement: Make sure the information describes the page represented by that url element and that the extensions appear after loc. The order of these extensions relative to one another does not matter.
  • Check size: Check the combined file, rather than relying on whether it met the limits before the extensions were combined.

If you encounter problems with a Sitemap, Google’s documentation recommends using Google Search Console to identify errors. For details on which fields to use and what to enter in them, consult the relevant extension’s documentation.

ProcrustesPRProcrustesPRWhere should I start if I want to do SEO myself?

Combining Sitemap extensions: perspectives from across the web

Which namespace should you use when adding only image extensions?

The image extension namespace listed in Google’s documentation is http://www.google.com/schemas/sitemap-image/1.1, which can be declared through an xmlns attribute on urlset. First confirm that you actually need image extensions, then add the tags according to the image Sitemap documentation. You do not need to copy other extensions’ namespaces simply because they appear in the example.

Which extension is used for hreflang annotations on localized pages?

Google’s documentation uses the xhtml namespace for hreflang annotations: http://www.w3.org/1999/xhtml. The documentation’s example lists language versions using xhtml:link tags. When adding them, you still need to consult the separate hreflang instructions to confirm how to fill in and place each tag.

Can the news and video fields in the combined example be treated as a complete format specification?

No. Google’s combined example shows tags for news titles and publication dates, as well as video titles and descriptions, but the material referenced in this article does not list the full field requirements for each extension. During implementation, check the documentation for every extension you use, whether for news, video, or another type of content. The combined example alone is not enough to determine whether the format is complete.

ProcrustesPRShould I rewrite or update an old article that does not rank?

References

  1. 如何合併 Sitemap 擴充元素 | Google 搜尋中心  |  Documentation  |  Google for Developersdevelopers.google.com — Discusses: Which namespace should you use when adding only image extensions?; Which extension is used for hreflang annotations on localized pages?

Related articles

How Long Does It Take to Evaluate SEO Results?Where should I start if I want to do SEO myself?Should I rewrite or update an old article that does not rank?What should I check when organic traffic suddenly drops?Why can I not find my published article on Google?Will Reposting Social Content on My Website Cause a Duplicate-Content Penalty?Eight SEO essentials for beginners: Getting your pages indexedWhat Is SEO? Understanding Optimization Priorities Through How Search Engines Work
ProcrustesPR
ProcrustesPR