# Create a video sitemap if needed

- Check 17.07 · Videos, PDFs and multimedia · Complementary
- Source: https://checklist-seo-geo.com/en/videos-pdfs-multimedia/create-video-sitemap-if-needed
- Decide whether a video sitemap is useful, generate it with WordPress, Laravel, Next.js or a script, then declare it in robots.txt and Search Console.
- Updated on 2026-11-25
- Licence: CC BY 4.0. Credit “Checklist SEO & GEO” with a link to https://checklist-seo-geo.com/en/videos-pdfs-multimedia/create-video-sitemap-if-needed.
- Plugin checklist-seo-geo: 1.3.1 · https://github.com/maximegaul/checklist-seo-geo

## 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

1. **Find the sitemap**: read the `Sitemap:` lines of `https://example.com/robots.txt` and open each file.
2. **Look for the video tags**:

```bash
curl -s https://example.com/sitemap-videos.xml | grep -c "<video:video>"
```

3. **Check that the XML is valid**:

```bash
curl -s https://example.com/sitemap-videos.xml | xmllint --noout - && echo "Valid XML"
```

4. **Test a few of the listed thumbnail and file URLs**: they must return `200`. See [check access to videos and thumbnails](https://checklist-seo-geo.com/en/videos-pdfs-multimedia/check-access-videos-thumbnails).
5. **In Search Console**, the [Sitemaps report](https://search.google.com/search-console/sitemaps) must show the “Success” status and a number of discovered videos; the [video page indexing report](https://search.google.com/search-console/video-index) can then be filtered on that sitemap.

## How to implement

### Before you start

Complete template, to adapt:

```xml
<?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](https://checklist-seo-geo.com/en/videos-pdfs-multimedia/implement-videoobject).
- 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 of `content_loc` for these platforms.
- Only canonical, indexable pages returning 200 belong in the sitemap. See [include only indexable canonical URLs](https://checklist-seo-geo.com/en/crawling/include-only-indexable-canonical-urls-returning-http-200).
- 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 in `Sitemap 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:

```php
// 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`:

```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:

```ts
// 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):

```python
#!/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>')
```

```bash
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

1. 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](https://checklist-seo-geo.com/en/crawling/declare-sitemaps-robotstxt).
2. Submit it in Search Console's [Sitemaps report](https://search.google.com/search-console/sitemaps), and in the Sitemaps section of Bing Webmaster Tools. See [submit sitemaps to Google and Bing](https://checklist-seo-geo.com/en/crawling/submit-sitemaps-google-bing).
3. Regenerate it whenever a video is published, modified or removed, like the rest of the sitemap. See [generate the XML sitemap automatically](https://checklist-seo-geo.com/en/crawling/generate-xml-sitemap-automatically).

## 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:video` must be exactly `http://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 feeds](https://developers.google.com/search/docs/crawling-indexing/sitemaps/video-sitemaps?hl=en)
- [Google Search Central: Manage your sitemaps](https://developers.google.com/search/docs/crawling-indexing/sitemaps/overview?hl=en)
- [Search Console Help: Sitemaps report](https://support.google.com/webmasters/answer/7451001?hl=en)
- [Spatie: laravel-sitemap](https://github.com/spatie/laravel-sitemap)
- [Next.js: sitemap.xml](https://nextjs.org/docs/app/api-reference/file-conventions/metadata/sitemap)
- [Rank Math: Video sitemap](https://rankmath.com/kb/video-sitemap/)

Next steps: [check access to videos and thumbnails](https://checklist-seo-geo.com/en/videos-pdfs-multimedia/check-access-videos-thumbnails) and [monitor video indexing](https://checklist-seo-geo.com/en/videos-pdfs-multimedia/monitor-video-indexing).
