Skip to main content

SEO sitemap for video thumbnails

  • A highly optimised sitemap for pages with videos

Code​

${VideoGuidesData.map((params) => {
return `
<url>
<loc>${`${EXTERNAL_DATA_URL}video-guides/${encodeURIComponent(params.slug)}`}</loc>
<lastmod>${getCurrentDateTime()}</lastmod>
<changefreq>daily</changefreq>
<priority>0.7</priority>
<video:video>
<video:thumbnail_loc>${getYouTubeThumbnail(params.videoURL)}</video:thumbnail_loc>
<video:title>${params.slug}</video:title>
<video:description>${escapeXml(params.description)}</video:description>
<video:player_loc allow_embed="yes">${`https://www.youtube.com/embed/${params.videoURL}`}</video:player_loc>
</video:video>
</url>
`;
}).join("")}