0

My web site is writing sitemaps dynamically when a user created a post. But I have a problem with sitemap types. I have to write separately to sitemap_image.xml,sitemap_url.xml,sitemap_video.xml files when a user write a post and upload images and videos to it.

My Question is:-

Can I write all things to one sitemap file under google SEO rules.?

Example

<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" 
xmlns:image="http://www.google.com/schemas/sitemap-image/1.1"
xmlns:video="http://www.google.com/schemas/sitemap-video/1.1">
   <url>
      <loc>http://www.example.com/page1.html</loc>
      <image:image>
         <image:loc>http://example.com/photo.jpg</image:loc>
         <image:title>Grey cat on the table</image:title>
         <image:license>https://creativecommons.org/licenses/by-sa/2.0/</image:license>
         <image:geo_location>Berlin, Germany</image:geo_location>
         <image:caption>Funny cat on the table is looking at photographer.</image:caption>
      </image:image>
      <video:video>            
         <video:thumbnail_loc>http://example.com/thumb1.jpg
         </video: thumbnail_loc>
         <video:title>Clown in the garden</video:title>
         <video:description>Crazy clown is riding a rabbit.</video:description>    
         <video:content_loc>http://www.example.com/video1.mp4</video:content_loc>
      </video:video>
   </url>
</urlset>

Thanks in advanced for any help and sorry for my bad english.

1

You should be able to have one sitemap that includes pages, images and video. It is likely a better format to have 3 different sitemaps for each type, but if this is taking up a lot of constraints on your server, then one sitemap for all should be valid.

You can use a separate sitemap to list images, or you can add image information to an existing sitemap. https://support.google.com/webmasters/answer/178636?hl=en


Here is a more complex sitemap that includes a single URL, as well as image and video file information for resources on that page:

xmlns:image="http://www.google.com/schemas/sitemap-image/1.1"
xmlns:video="http://www.google.com/schemas/sitemap-video/1.1">

<loc>http://www.example.com/foo.html</loc> 
<image:image>
   <image:loc>http://example.com/image.jpg</image:loc>
   <image:caption>Dogs playing poker</image:caption>
</image:image>
<video:video>
  <video:content_loc>
    http://www.example.com/video123.flv
  </video:content_loc>
  <video:player_loc allow_embed="yes" autoplay="ap=1">
    http://www.example.com/videoplayer.swf?video=123
  </video:player_loc>
  <video:thumbnail_loc>
    http://www.example.com/thumbs/123.jpg
  </video:thumbnail_loc>
  <video:title>Grilling steaks for summer</video:title>  
  <video:description>
    Cook the perfect steak every time.
  </video:description>
</video:video>   </url> </urlset>

source: https://support.google.com/webmasters/answer/183668?hl=en&ref_topic=4581190 under XML dropdown

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.