In short
A video sitemap is an XML sitemap extended with <video:video> tags that list, for each page, the videos it contains: title, description, thumbnail, URL of the file or player. It helps Google discover videos it would struggle to find on its own. Once the task is done, if your site needs one, an automatically generated video sitemap lists all the watch pages, with values identical to the structured data, and it is declared in robots.txt and submitted to Search Console.
Why it matters
Google discovers videos through the page's tags (<video>, <iframe>, <embed>, <object>), through structured data, through Open Graph and through video sitemaps. The sitemap does not replace the other signals; it becomes useful when discovery is difficult:
- many videos, published often;
- videos loaded by JavaScript or by a third-party player that Google detects poorly;
- watch pages with few links from the rest of the site;
- a need to declare an expiration date or a country restriction without touching the pages.
For a site with five videos on well-linked pages marked up with VideoObject, it adds little. That is the meaning of the task's “if needed”.
The format is documented by Google: the http://www.google.com/schemas/sitemap-video/1.1 namespace, the required tags <video:thumbnail_loc>, <video:title>, <video:description> (2,048 characters at most), and at least one of the two URLs <video:content_loc> or <video:player_loc>, which must not be the same as the page URL. Video tags can be added to an existing sitemap or placed in a separate file. The general sitemap limits apply: 50,000 URLs and 50 MB uncompressed per file.
On the GEO side, no generative engine documents any use of video sitemaps. Their value lies in Google Search.
What it improves
- Video discovery by Google, especially for large catalogs and sites that load their players with JavaScript.
- Control Expiration dates and country and platform restrictions declared in one place.
- Diagnostics In Search Console, the video page indexing report can be filtered by sitemap.
- Rankings No effect. A sitemap helps discovery, not ranking.
How to check
- Find the sitemap: read the
Sitemap:lines ofhttps://example.com/robots.txtand open each file. - Look for the video tags:
curl -s https://example.com/sitemap-videos.xml | grep -c "<video:video>"
- Check that the XML is valid:
curl -s https://example.com/sitemap-videos.xml | xmllint --noout - && echo "Valid XML"
- Test a few of the listed thumbnail and file URLs: they must return
200. See check access to videos and thumbnails (opens in a new tab). - In Search Console, the Sitemaps report must show the “Success” status and a number of discovered videos; the video page indexing report can then be filtered on that sitemap.
How to implement
Before you start
Complete template, to adapt:
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
xmlns:video="http://www.google.com/schemas/sitemap-video/1.1">
<url>
<loc>https://example.com/videos/detartrer-chauffe-eau/</loc>
<video:video>
<video:thumbnail_loc>https://example.com/media/miniatures/detartrage-200l.jpg</video:thumbnail_loc>
<video:title>Descale an electric water heater in 6 steps</video:title>
<video:description>Shutting off, draining, removing the anode, cleaning and refilling a 200-liter electric water heater.</video:description>
<video:content_loc>https://example.com/media/videos/detartrage-200l.mp4</video:content_loc>
<video:player_loc>https://example.com/videos/lecteur/detartrage-200l</video:player_loc>
<video:duration>510</video:duration>
<video:publication_date>2026-10-14T09:00:00+02:00</video:publication_date>
<video:family_friendly>yes</video:family_friendly>
<video:requires_subscription>no</video:requires_subscription>
<video:live>no</video:live>
</video:video>
</url>
</urlset>
Useful optional tags:
| Tag | Value | Use |
|---|---|---|
<video:duration> |
Seconds, from 1 to 28,800 | Actual duration |
<video:publication_date> |
W3C date | First publication |
<video:expiration_date> |
W3C date | Only if the video will be removed |
<video:restriction relationship="allow"> |
Space-separated ISO 3166 country codes | Limit display in search results |
<video:platform relationship="deny"> |
web, mobile, tv |
Exclude a platform |
<video:family_friendly> |
yes or no |
no: shown only with SafeSearch off |
<video:uploader info="…"> |
Name, 255 characters at most; info on the same domain as <loc> |
Author |
<video:tag> |
One keyword per tag, 32 at most | Optional |
Rules:
- One
<video:video>entry per video on the page; do not list videos unrelated to the main content of the page. - The same values as the VideoObject JSON-LD and the page: title, thumbnail, description. See implement VideoObject (opens in a new tab).
- Escape
&,<and>in text, or wrap it in<![CDATA[ ]]>. - For an embedded YouTube or Vimeo video,
<video:player_loc>takes the embed URL; Google uses it instead ofcontent_locfor these platforms. - Only canonical, indexable pages returning 200 belong in the sitemap. See include only indexable canonical URLs (opens in a new tab).
- Do not add an expiration date to a video that remains available.
The <video:category>, <video:gallery_loc>, <video:price> and <video:tvshow> tags have been removed from Google's documentation: stop using them.
WordPress
Versions WordPress 6.5 to 7.1; Yoast Video SEO (paid Yoast plans) and Rank Math, November 2026 versions.
- Yoast Video SEO (included in Yoast's paid plans) creates and updates a video sitemap for videos from YouTube, Vimeo, Wistia, VideoPress and other hosts.
- Rank Math: enable the “Video Sitemap” module in
Rank Math SEO > Dashboard > Modules(the Schema and Sitemap modules must be active), then configure it inSitemap Settings > Video Sitemap: post types to scan, optional YouTube API key, custom fields to scan. Check Rank Math's plan comparison to see what your version includes. - WordPress's native sitemap (
/wp-sitemap.xml) does not handle video tags.
After enabling it, open the video sitemap, check a few entries, then submit the sitemap index in Search Console.
Laravel
Versions Laravel 11 to 13 with spatie/laravel-sitemap 7 (Laravel 11 and 12) or 8 (Laravel 12 and 13).
The spatie/laravel-sitemap package handles videos with addVideo(). In a scheduled command:
// app/Console/Commands/GenerateVideoSitemapCommand.php
namespace App\Console\Commands;
use App\Models\Video;
use Illuminate\Console\Command;
use Spatie\Sitemap\Sitemap;
use Spatie\Sitemap\Tags\Url;
class GenerateVideoSitemapCommand extends Command
{
protected $signature = 'generate-video-sitemap';
protected $description = 'Generates public/sitemap-videos.xml';
public function handle(): void
{
$sitemap = Sitemap::create();
$videos = Video::query()->published()->get();
$videos->each(function (Video $video) use ($sitemap): void {
$this->info("Adding video `{$video->slug}`...");
$url = Url::create(route('videos.show', $video))
->setLastModificationDate($video->updated_at)
->addVideo(
$video->thumbnail_url,
$video->title,
$video->summary,
$video->content_url,
null,
[
'duration' => $video->duration_seconds,
'publication_date' => $video->published_at->toAtomString(),
'family_friendly' => 'yes',
],
);
$sitemap->add($url);
});
$sitemap->writeToFile(public_path('sitemap-videos.xml'));
$this->comment("{$videos->count()} videos written to sitemap-videos.xml.");
}
}
addVideo() requires at least a file or player URL. Each key of the options array becomes a <video:…> tag. Restrictions go through the $allow or $deny parameter: ['restriction' => 'FR BE CH']. Schedule the command in routes/console.php:
use Illuminate\Support\Facades\Schedule;
Schedule::command('generate-video-sitemap')->daily();
Next.js
Versions Next.js 15 and 16 (App Router).
The app/sitemap.ts file accepts a videos property. The example in the Next.js documentation only shows the title, thumbnail and description; add content_loc or player_loc, which Google requires:
// app/sitemap-videos/sitemap.ts
import type { MetadataRoute } from 'next';
import { getVideos } from '@/lib/videos';
export default async function sitemap(): Promise<MetadataRoute.Sitemap> {
const videos = await getVideos();
return videos.map((video) => ({
url: `https://example.com/videos/${video.slug}/`,
lastModified: video.updatedAt,
videos: [
{
title: video.title,
thumbnail_loc: video.thumbnailUrl,
description: video.summary,
content_loc: video.contentUrl,
duration: video.durationSeconds,
publication_date: video.publishedAt,
family_friendly: 'yes',
},
],
}));
}
The file is served at /sitemap-videos/sitemap.xml. Beyond 50,000 URLs, split it with generateSitemaps.
Shopify
Versions all Shopify plans, November 2026.
Shopify generates its sitemap automatically and does not let you add video tags to it. Product page videos are not on watch pages anyway. For strategic videos, rely on dedicated pages, VideoObject structured data and, if they are on YouTube, on the platform itself. Some apps in the App Store offer a video sitemap: check the XML they produce before submitting it.
Universal script
On a static site, or any CMS without a suitable plugin, generate the file from a spreadsheet exported as CSV (columns page,miniature,titre,description,fichier,lecteur,duree,publication: page, thumbnail, title, description, file, player, duration, publication date):
#!/usr/bin/env python3
import csv
import sys
from xml.sax.saxutils import escape
entrees = []
with open(sys.argv[1], newline='', encoding='utf-8') as fichier:
for ligne in csv.DictReader(fichier):
balises = [
f"<video:thumbnail_loc>{escape(ligne['miniature'])}</video:thumbnail_loc>",
f"<video:title>{escape(ligne['titre'])}</video:title>",
f"<video:description>{escape(ligne['description'][:2048])}</video:description>",
]
if ligne['fichier']:
balises.append(f"<video:content_loc>{escape(ligne['fichier'])}</video:content_loc>")
if ligne['lecteur']:
balises.append(f"<video:player_loc>{escape(ligne['lecteur'])}</video:player_loc>")
if ligne['duree']:
balises.append(f"<video:duration>{int(ligne['duree'])}</video:duration>")
if ligne['publication']:
balises.append(f"<video:publication_date>{escape(ligne['publication'])}</video:publication_date>")
video = "\n ".join(balises)
entrees.append(f" <url>\n <loc>{escape(ligne['page'])}</loc>\n <video:video>\n {video}\n </video:video>\n </url>")
print('<?xml version="1.0" encoding="UTF-8"?>')
print('<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:video="http://www.google.com/schemas/sitemap-video/1.1">')
print("\n".join(entrees))
print('</urlset>')
python3 generer-sitemap-videos.py videos.csv > public/sitemap-videos.xml
The script assumes that each row has at least a file or a player; check the output with xmllint.
Declare and submit
- Add the file to your sitemap index, or declare it in robots.txt:
Sitemap: https://example.com/sitemap-videos.xml. See declare sitemaps in robots.txt (opens in a new tab). - Submit it in Search Console's Sitemaps report, and in the Sitemaps section of Bing Webmaster Tools. See submit sitemaps to Google and Bing (opens in a new tab).
- Regenerate it whenever a video is published, modified or removed, like the rest of the sitemap. See generate the XML sitemap automatically (opens in a new tab).
Common mistakes
<video:player_loc>or<video:content_loc>equal to<loc>: you need the URL of the player or the file, not the page's.- A wrong or missing namespace:
xmlns:videomust be exactlyhttp://www.google.com/schemas/sitemap-video/1.1. - Unescaped ampersands in URLs or titles: the file becomes invalid.
- A thumbnail or file URL that expires, or that is blocked by robots.txt.
- A sitemap generated once and then forgotten: deleted videos still listed, new ones missing.
- Removed tags (
<video:category>,<video:price>) still present. - Listing pages that are not watch pages and hoping they will become watch pages.
- Values that differ from the JSON-LD: two titles, two thumbnails for the same video.
Frequently asked questions
Is a video sitemap required?
No. Google also discovers videos through the page's tags, VideoObject structured data and Open Graph. A video sitemap becomes useful when videos are numerous, published often, loaded by JavaScript or poorly linked to the rest of the site, or when you need to declare expiration dates and country restrictions. For a few videos on well-linked, marked-up pages, it adds little.
Do videos need a separate file?
It is not required. Google accepts video tags in an existing sitemap as well as in a dedicated file. A separate file, for example sitemap-videos.xml, is easier to generate, check and monitor in Search Console, because you can filter the video page indexing report on that sitemap alone. Declare it in your sitemap index or in robots.txt.
Can I put YouTube videos in a video sitemap?
Yes, for YouTube videos embedded on your own watch pages. The loc tag contains your page's URL, and video:player_loc the embed URL of the YouTube video, which Google uses for these platforms. Add the title, the description and the thumbnail. Google can then index your page in addition to the YouTube page, if it meets its criteria.
Which tags are required in a video sitemap?
For each video, Google requires video:thumbnail_loc, video:title, video:description, limited to 2,048 characters, and at least one of the two tags video:content_loc or video:player_loc, which must not repeat the page URL. The tags for duration, publication date, expiration, country restriction or platform are optional, but useful when the information exists.
Resources
- Google Search Central: Video sitemaps and mRSS feedsdevelopers.google.com
- Google Search Central: Manage your sitemapsdevelopers.google.com
- Search Console Help: Sitemaps reportsupport.google.com
- Spatie: laravel-sitemapgithub.com
- Next.js: sitemap.xmlnextjs.org
- Rank Math: Video sitemaprankmath.com
Updated on
Topic checklist (PDF)