Sub topic 13
Image, video, news, and hreflang extensions
This chapter assumes you can read a basic urlset sitemap with loc and lastmod entries, and that you know what XML namespaces look like. Extensions add extra data to a normal <url> entry. They do not replace the standard format.
How extensions work
Each extension lives in its own XML namespace. You declare the namespace on the <urlset> element and prefix the new tags with it. The core sitemap rules still apply: absolute URLs, UTF-8 encoding, and the same size limits.
| Extension | Namespace prefix | What it describes |
|---|---|---|
| Image | `image` | Images that appear on a page |
| Video | `video` | Video files or players on a page |
| News | `news` | Recently published news articles |
| hreflang | `xhtml` | Language and region versions of a page |
Image sitemaps
An image entry lists images that belong to a page. This helps crawlers find images that are loaded by JavaScript or are otherwise hard to discover. You can list up to 1,000 images per page URL.
Only image:loc is needed. Google has deprecated the optional caption, title, geo-location, and license tags, so you can leave them out.
Video sitemaps
A video entry needs more information. Each video:video element must contain these tags:
video:thumbnail_loc: the URL of a preview image.video:titleandvideo:description: text shown in search results.video:content_locorvideo:player_loc: the video file or the embeddable player. Give at least one.
Optional tags include video:duration (in seconds) and video:publication_date.
News sitemaps
A news sitemap is for publishers that are included in Google News. Each entry has a news:news element with the publication's name and language, the article's publication date, and its title. Include only articles published in the last two days, and no more than 1,000 per sitemap. Remove older articles when they age out.
hreflang annotations
If a page exists in several languages or regions, you can declare the versions in the sitemap with xhtml:link elements. Every URL must list all of its alternates, including itself. If page A points to page B but B does not point back to A, crawlers may ignore the annotation.
Example: images and hreflang together
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
xmlns:image="http://www.google.com/schemas/sitemap-image/1.1"
xmlns:xhtml="http://www.w3.org/1999/xhtml">
<url>
<loc>https://www.example.com/en/shoes</loc>
<lastmod>2026-11-01</lastmod>
<image:image>
<image:loc>https://www.example.com/img/shoes-red.jpg</image:loc>
</image:image>
<xhtml:link rel="alternate" hreflang="en" href="https://www.example.com/en/shoes"/>
<xhtml:link rel="alternate" hreflang="de" href="https://www.example.com/de/schuhe"/>
</url>
<url>
<loc>https://www.example.com/de/schuhe</loc>
<lastmod>2026-11-01</lastmod>
<xhtml:link rel="alternate" hreflang="en" href="https://www.example.com/en/shoes"/>
<xhtml:link rel="alternate" hreflang="de" href="https://www.example.com/de/schuhe"/>
</url>
</urlset>Both pages carry the same pair of xhtml:link lines. That reciprocity is what makes the annotation valid.
Common errors
- Missing namespace declaration. Using
image:locwithout declaringxmlns:imagemakes the file invalid XML. - One-way hreflang. Alternates that do not link back, or that omit the page itself, can be ignored.
- Blocked assets. If robots.txt disallows the image or video file, crawlers cannot fetch it, even though the sitemap lists it.
- Stale news entries. Articles older than two days do not belong in a news sitemap.
- Incomplete video entries. A missing thumbnail, title, description, or content/player URL makes the entry unusable.
Exercise
A sitemap lists https://www.example.com/en/page with an hreflang link to https://www.example.com/fr/page. The French page's sitemap entry has no hreflang links at all. What is wrong, and how do you fix it?
Show answer
The annotation is not reciprocal, so crawlers may ignore it. Add hreflang links to the French entry that list both the English and French URLs, so that each page lists all alternates including itself.
Exercise
Which two namespace declarations does a sitemap need if its entries include both images and hreflang alternates?
Show answer
xmlns:image="http://www.google.com/schemas/sitemap-image/1.1" for the image tags, and xmlns:xhtml="http://www.w3.org/1999/xhtml" for the xhtml:link tags. The default sitemap namespace is also required.