Sitemap with Google extensions
Image, video and news sitemaps
A sitemap.xml that also lists images, videos or news articles with Google's sitemap extensions.
About
Google reads extra tags in a sitemap: image:image for pictures on a page, video:video for videos and news:news for Google News articles. Each has its own schema, published by Google.
This entry loads the sitemap schema together with the three extension schemas through a small wrapper schema by xmlvalid.com, so a sitemap can mix them.
Good to know
- Google has since deprecated some extension tags (for example image:caption and video:category); the schemas still allow them, and Google ignores them.
- URL counts, file size limits and whether the URLs work are not checked.
- The example is by xmlvalid.com.
Files
5 files · 38.3 KB-
sitemap-extensions.xsd main
-
sitemap.xsd
-
sitemap-image.xsd
-
sitemap-video.xsd
-
sitemap-news.xsd
The validator loads all of these with their folder structure, so includes and imports resolve as published.
Example document
sitemap-extensions.xml · 1.7 KB · valid against this schema
In CI and from code
The same schema by its name, sitemap-extensions, through the API.
npx @xmlvalid/cli validate "**/*.xml" --schema sitemap-extensions
- uses: xmlvalid/validate-action@v1
with:
files: "**/*.xml"
schema: sitemap-extensions
api-key: ${{ secrets.XMLVALID_API_KEY }}
curl https://xmlvalid.com/api/v1/validations \
-H "Authorization: Bearer $XMLVALID_API_KEY" \
-F document={{ $schema->example ?? 'document.xml' }} -F schema=sitemap-extensions
Free accounts get 100 API validations a month. On Pro, a URL monitor can check a published document against this schema every hour and email you when it breaks. More CI setups