Images, Videos, News · Nuxt Sitemap · Nuxt SEO

[NuxtSEO](https://nuxtseo.com/ "Home")

- [Modules](https://nuxtseo.com/docs/nuxt-seo/getting-started/introduction)
- [Tools](https://nuxtseo.com/tools)
- [Pro](https://nuxtseo.com/pro)
- [Learn SEO](https://nuxtseo.com/learn-seo/nuxt) [Releases](https://nuxtseo.com/releases)

[1.4K](https://github.com/harlan-zw/nuxt-seo)

[Nuxt SEO on GitHub](https://github.com/harlan-zw/nuxt-seo)

[User Guides](https://nuxtseo.com/docs/sitemap/getting-started/introduction)

[API](https://nuxtseo.com/docs/sitemap/api/config)

[Releases](https://nuxtseo.com/docs/sitemap/releases/v8)

Sitemap

- [Switch to Sitemap](https://nuxtseo.com/docs/sitemap/getting-started/introduction)
- [Switch to Nuxt SEO](https://nuxtseo.com/docs/nuxt-seo/getting-started/introduction)
- [Switch to Robots](https://nuxtseo.com/docs/robots/getting-started/introduction)
- [Switch to OG Image](https://nuxtseo.com/docs/og-image/getting-started/introduction)
- [Switch to Schema.org](https://nuxtseo.com/docs/schema-org/getting-started/introduction)
- [Switch to Link Checker](https://nuxtseo.com/docs/link-checker/getting-started/introduction)
- [Switch to SEO Utils](https://nuxtseo.com/docs/seo-utils/getting-started/introduction)
- [Switch to Site Config](https://nuxtseo.com/docs/site-config/getting-started/introduction)
- [Switch to Skew Protection](https://nuxtseo.com/docs/skew-protection/getting-started/introduction)
- [Switch to AI Ready](https://nuxtseo.com/docs/ai-ready/getting-started/introduction)

Search…```k`` /`

v8.0.12

- Playgrounds
- [Discord Support](https://discord.com/invite/275MBUBvgP)

### Getting Started

- [Introduction](https://nuxtseo.com/docs/sitemap/getting-started/introduction)
- [Installation](https://nuxtseo.com/docs/sitemap/getting-started/installation)
- [Data Sources](https://nuxtseo.com/docs/sitemap/getting-started/data-sources)
- [Troubleshooting](https://nuxtseo.com/docs/sitemap/getting-started/troubleshooting)

### Core Concepts

- [Dynamic URL Endpoints](https://nuxtseo.com/docs/sitemap/guides/dynamic-urls)
- [Disabling Indexing](https://nuxtseo.com/docs/sitemap/guides/filtering-urls)
- [Multi Sitemaps](https://nuxtseo.com/docs/sitemap/guides/multi-sitemaps)
- [I18n](https://nuxtseo.com/docs/sitemap/guides/i18n)
- [Nuxt Content](https://nuxtseo.com/docs/sitemap/guides/content)
- [Nuxt Prerendering](https://nuxtseo.com/docs/sitemap/guides/prerendering)
- [Best Practices](https://nuxtseo.com/docs/sitemap/guides/best-practices)
- [Submitting Your Sitemap](https://nuxtseo.com/docs/sitemap/guides/submitting-sitemap)
- [Zero Runtime](https://nuxtseo.com/docs/sitemap/guides/zero-runtime)

### Advanced

- [Lastmod, Priority, and Changefreq](https://nuxtseo.com/docs/sitemap/advanced/loc-data)
- [Images, Videos, News](https://nuxtseo.com/docs/sitemap/advanced/images-videos)
- [Sitemap Performance](https://nuxtseo.com/docs/sitemap/advanced/performance)
- [Sitemap Chunking](https://nuxtseo.com/docs/sitemap/advanced/chunking-sources)
- [Customising the UI](https://nuxtseo.com/docs/sitemap/advanced/customising-ui)

Advanced

# Images, Videos, News

[Copy for LLMs](https://nuxtseo.com/docs/sitemap/advanced/images-videos.md)

## [Introduction](#introduction)

The `image`, `video` and `news` namespaces is added to your sitemap by default, allowing you to configure images, videos and news for your sitemap entries.

When prerendering your app, it's possible for the generated sitemap to automatically infer images and videos from your pages.

## [Sitemap Images](#sitemap-images)

To add images to your sitemap, you can use the `images` property on the sitemap entry.

You can learn more about images in sitemaps on the [Google documentation](https://developers.google.com/search/docs/advanced/sitemaps/image-sitemaps).

```
export interface ImageEntry {
  loc: string | URL
  caption?: string
  geo_location?: string
  title?: string
  license?: string | URL
}
```

You can implement this as follows:

nuxt.config.ts

```
export default defineNuxtConfig({
  sitemap: {
    urls: [
      {
        loc: '/blog/my-post',
        images: [
          {
            loc: 'https://example.com/image.jpg',
            caption: 'My image caption',
            geo_location: 'My image geo location',
            title: 'My image title',
            license: 'My image license',
          }
        ]
      }
    ]
  }
})
```

### [Automatic Image Discovery](#automatic-image-discovery)

The module can discover images in your page and add them to your sitemap automatically.

For this to work:

- The page _must_ be prerendered. These images will not be shown in development or if the page is not prerendered.
- You must wrap your page content with a `<main>` tag, avoid wrapping shared layouts that include duplicate images.

## [Videos](#videos)

To add videos to your sitemap, you can use the `videos` property on the sitemap entry.

**Google Video Indexing Change**As of late 2023, Google **only indexes videos if they are the main content of the page**. If a video is supplementary to the text (like a blog post with a video at the bottom), the video itself may not be indexed in video search results, though the page will still be indexed normally.

The TypeScript interface for videos is as follows:

```
export interface VideoEntry {
  title: string
  thumbnail_loc: string | URL
  description: string
  content_loc?: string | URL
  player_loc?: string | URL
  duration?: number
  expiration_date?: Date | string
  rating?: number
  view_count?: number
  publication_date?: Date | string
  family_friendly?: 'yes' | 'no' | boolean
  restriction?: Restriction
  platform?: Platform
  price?: ({
    price?: number | string
    currency?: string
    type?: 'rent' | 'purchase' | 'package' | 'subscription'
  })[]
  requires_subscription?: 'yes' | 'no' | boolean
  uploader?: {
    uploader: string
    info?: string | URL
  }
  live?: 'yes' | 'no' | boolean
  tag?: string | string[]
  category?: string
  gallery_loc?: string | URL
}
```

You can learn more about videos in sitemaps on the [Google documentation](https://developers.google.com/search/docs/advanced/sitemaps/video-sitemaps).

You can implement this as follows:

nuxt.config.ts

```
export default defineNuxtConfig({
  sitemap: {
    urls: [
      {
        loc: '/blog/my-post',
        videos: [
          {
            title: 'My video title',
            thumbnail_loc: 'https://example.com/video.jpg',
            description: 'My video description',
            content_loc: 'https://example.com/video.mp4',
            player_loc: 'https://example.com/video.mp4',
            duration: 600,
            expiration_date: '2021-01-01',
            rating: 4.2,
            view_count: 1000,
            publication_date: '2021-01-01',
            family_friendly: true,
            restriction: {
              relationship: 'allow',
              restriction: 'US CA',
            },
            platform: {
              relationship: 'allow',
              platform: 'web',
            },
            price: [
              {
                price: 1.99,
                currency: 'USD',
                type: 'rent',
              }
            ],
            requires_subscription: true,
            uploader: {
              uploader: 'My video uploader',
              info: 'https://example.com/uploader',
            },
            live: true,
            tag: ['tag1', 'tag2'],
          }
        ]
      }
    ]
  }
})
```

### [Automatic Video Discovery](#automatic-video-discovery)

Like automatic image discovery, you can opt-in to automatic video discovery including video markup in your `<main>` tag.

You are also required to provide a title and description for your video, this can be done using the `data-title` and `data-description` attributes.

Simple

```
<video
    controls
    poster="https://archive.org/download/DuckAndCover_185/__ia_thumb.jpg"
    width="620"
    data-title="Duck and Cover"
    data-description="This film, a combination of animated cartoon and live action, shows young children what to do in case of an atomic attack."
>
    <source
        src="https://archive.org/download/DuckAndCover_185/CivilDefenseFilm-DuckAndCoverColdWarNuclearPropaganda_512kb.mp4"
        type="video/mp4"
    />
    <source
        src="https://archive.org/download/DuckAndCover_185/CivilDefenseFilm-DuckAndCoverColdWarNuclearPropaganda.avi"
        type="video/x-msvideo"
    />
    Sorry, your browser doesn't support embedded videos. However, you can
    <a href="https://archive.org/details/DuckAndCover_185">download it</a>
    and watch it with your favorite video player!
</video>
```

Full

```
<video
    controls
    poster="https://archive.org/download/DuckAndCover_185/__ia_thumb.jpg"
    width="620"
    data-title="Duck and Cover"
    data-description="This film, a combination of animated cartoon and live action, shows young children what to do in case of an atomic attack."
    data-rating="4.2"
    data-view-count="1000"
    data-publication-date="2021-01-01"
    data-family-friendly="yes"

>
```

Each format would be added to your sitemap in the following format:

```
<video:video>
    <video:thumbnail_loc>https://archive.org/download/DuckAndCover_185/__ia_thumb.jpg</video:thumbnail_loc>
    <video:title>Duck and Cover</video:title>
    <video:description>
        This film, a combination of animated cartoon and live action, shows young children what to do in case of an atomic attack.
    </video:description>
    <video:content_loc>
        https://archive.org/download/DuckAndCover_185/CivilDefenseFilm-DuckAndCoverColdWarNuclearPropaganda_512kb.mp4
    </video:content_loc>
</video:video>
```

## [News](#news)

To add news to your sitemap, you can use the `news` property on the sitemap entry. Only [Google's News sitemap](https://developers.google.com/search/docs/crawling-indexing/sitemaps/news-sitemap) extension is supported.

The TypeScript interface for news is as follows:

```
export interface GoogleNewsEntry {
  title: string
  publication_date: Date | string
  publication: {
    name: string
    language: string
  }
}
```

You can implement this as follows:

nuxt.config.ts

```
export default defineNuxtConfig({
  sitemap: {
    urls: [
      {
        loc: '/news/nuxt-sitemap-turns-6',
        news: {
          title: 'Nuxt Sitemap Turns 6',
          publication_date: '2021-01-01',
          publication: {
            name: 'Nuxt Sitemap',
            language: 'en',
          },
        }
      }
    ]
  }
})
```

## [Image & Video Opt-out](#image-video-opt-out)

To opt-out of this behaviour, you can set the `discoverImages` and `discoverVideos` config to `false` respectively.

nuxt.config.ts

```
export default defineNuxtConfig({
  sitemap: {
    discoverImages: false,
    discoverVideos: false,
  }
})
```

[Edit this page](https://github.com/nuxt-modules/sitemap/edit/main/docs/content/2.advanced/1.images-videos.md)

[Markdown For LLMs](https://nuxtseo.com/docs/sitemap/advanced/images-videos.md)

Did this page help you?

### Related

[Nuxt Prerendering](https://nuxtseo.com/docs/sitemap/guides/prerendering) [Best Practices](https://nuxtseo.com/docs/sitemap/guides/best-practices)

[Lastmod, Priority, and Changefreq Configure lastmod, priority, and changefreq values for your sitemap entries.](https://nuxtseo.com/docs/sitemap/advanced/loc-data) [Sitemap Performance Use the default cache engine to keep your sitemaps fast.](https://nuxtseo.com/docs/sitemap/advanced/performance)

On this page

- [Introduction](#introduction)
- [Sitemap Images](#sitemap-images)
- [Videos](#videos)
- [News](#news)
- [Image & Video Opt-out](#image-video-opt-out)

[GitHub](https://github.com/harlan-zw/nuxt-seo) [ Discord](https://discord.com/invite/275MBUBvgP)

### [NuxtSEO](https://nuxtseo.com/ "Home")

- [Getting Started](https://nuxtseo.com/docs/nuxt-seo/getting-started/introduction)
- [MCP](https://nuxtseo.com/docs/nuxt-seo/guides/mcp)

Modules

- [Robots](https://nuxtseo.com/docs/robots/getting-started/introduction)
- [Sitemap](https://nuxtseo.com/docs/sitemap/getting-started/introduction)
- [OG Image](https://nuxtseo.com/docs/og-image/getting-started/introduction)
- [Schema.org](https://nuxtseo.com/docs/schema-org/getting-started/introduction)
- [Link Checker](https://nuxtseo.com/docs/link-checker/getting-started/introduction)
- [SEO Utils](https://nuxtseo.com/docs/seo-utils/getting-started/introduction)
- [Site Config](https://nuxtseo.com/docs/site-config/getting-started/introduction)
- [Skew Protection](https://nuxtseo.com/docs/skew-protection/getting-started/introduction)
- [AI Ready](https://nuxtseo.com/docs/ai-ready/getting-started/introduction)

### [NuxtSEO Pro](https://nuxtseo.com/pro "Home")

- [Getting Started](https://nuxtseo.com/pro)
- [Dashboard](https://nuxtseo.com/pro/dashboard)
- [Pro MCP](https://nuxtseo.com/docs/nuxt-seo-pro/mcp/installation)

### [Learn SEO](https://nuxtseo.com/learn-seo "Learn SEO")

Nuxt

- [Mastering Meta](https://nuxtseo.com/learn-seo/nuxt/mastering-meta)
- [Controlling Crawlers](https://nuxtseo.com/learn-seo/nuxt/controlling-crawlers)
- [Launch & Listen](https://nuxtseo.com/learn-seo/nuxt/launch-and-listen)
- [Routes & Rendering](https://nuxtseo.com/learn-seo/nuxt/routes-and-rendering)
- [Staying Secure](https://nuxtseo.com/learn-seo/nuxt/routes-and-rendering/security)

Vue

- [Vue SEO Guide](https://nuxtseo.com/learn-seo/vue)
- [Mastering Meta](https://nuxtseo.com/learn-seo/vue/mastering-meta)
- [Controlling Crawlers](https://nuxtseo.com/learn-seo/vue/controlling-crawlers)
- [SPA SEO](https://nuxtseo.com/learn-seo/vue/spa)
- [SSR Frameworks](https://nuxtseo.com/learn-seo/vue/ssr-frameworks)
- [SEO Checklist](https://nuxtseo.com/learn-seo/checklist)
- [Pre-Launch Warmup](https://nuxtseo.com/learn-seo/pre-launch-warmup)
- [Backlinks & Authority](https://nuxtseo.com/learn-seo/backlinks)

### [Tools](https://nuxtseo.com/tools "SEO Tools")

- [Social Share Debugger](https://nuxtseo.com/tools/social-share-debugger)
- [Robots.txt Generator](https://nuxtseo.com/tools/robots-txt-generator)
- [Meta Tag Checker](https://nuxtseo.com/tools/meta-tag-checker)
- [HTML to Markdown](https://nuxtseo.com/tools/html-to-markdown)
- [XML Sitemap Validator](https://nuxtseo.com/tools/xml-sitemap-validator)
- [Schema.org Validator](https://nuxtseo.com/tools/schema-validator)
- [Keyword Idea Generator](https://nuxtseo.com/tools/keyword-generator)
- [Keyword Research](https://nuxtseo.com/tools/keyword-research)
- [SERP Analyzer](https://nuxtseo.com/tools/serp-analyzer)
- [Domain Rankings](https://nuxtseo.com/tools/domain-rankings)

Copyright © 2023-2026 Harlan Wilton - [MIT License](https://github.com/harlan-zw/nuxt-seo/blob/main/license) · [mdream](https://mdream.dev)