Video sitemap doesn’t work when I have Custom Post Type ‘Video’?

Yoast SEO: Video will automatically detect a naming collision and change the video sitemap name. Please go to Admin > SEO > Video SEO and click the 'XML Video Sitemap' link to get the correct sitemap URL.

If you prefer to give your video sitemap a custom name, please use the developer filter discussed below.

How to Change the Video Sitemap URL

  1. Disable the sitemap feature.

    Disable all sitemaps by following the steps in this article.

  2. Add the filter in your theme's functions.php file.

    See the example code below.

  3. Enable the sitemap feature.

    Enable all sitemaps by following the steps in this article.

This will create two sitemaps; one for the video custom post type and one specifically formatted to meet video sitemap guidelines.

Video Post Type = www.example.com/video-sitemap.xml
Video Format = www.example.com/vsvideo-sitemap.xml

Developer code

The following information is written for advanced users and developers.

You can replace vsvideo with your preferred choice.

define ('YOAST_VIDEO_SITEMAP_BASENAME', 'vsvideo');

Was this article helpful? ·