How to Build an HTML Sitemap in WordPress
A visitor-facing HTML sitemap is a WordPress page that organizes links to your site’s pages and posts so people can browse them…
When a website has important images or videos, search engines need to find both the page that contains the media and the media file itself. An XML sitemap is a file that lists website URLs for search engines. Image and video sitemap entries add details that connect media files to the pages where visitors can find them.
A dedicated sitemap is a separate file for image or video entries. Google also accepts image and video details in an existing sitemap, so separate files are a matter of organization, not a ranking requirement. Choose the layout that helps you create accurate entries, fix errors, and keep media URLs current.
Separate image and video sitemaps let site owners manage each type of content on its own. For example, a site could create an image sitemap for product pages and a video sitemap for pages where visitors watch videos. One combined sitemap uses fewer files and can describe both types of media on the same page. Google supports both arrangements and allows sitemap extensions to share a page entry.
Whichever layout you choose, each entry must link media to the page where it appears. Do not list an image or video as a separate page. Google recommends that sites with more than a few dozen URLs generate sitemaps automatically; its guidance on combining sitemap extensions explains the supported layouts.
In an image sitemap, the outer <loc> gives the URL of the page that contains the image. Each nested <image:loc> gives the URL of an image file on that page. This tells search engines which page provides context for each image.
https://www.example.com/products/blue-chair
https://cdn.example.com/images/blue-chair-front.jpg
https://cdn.example.com/images/blue-chair-side.jpg
Google permits up to 1,000 image entries for a single page entry. It also allows image files on a different domain, such as a content delivery network (CDN), when the relevant domains are verified in Search Console and the files are crawlable. See Google’s image sitemap requirements.
An image sitemap helps search engines discover images, including images that JavaScript loads. Still, Google recommends standard HTML image elements, and it does not index CSS background images. For responsive images, include a fallback src value. List only images that belong on the page named in <loc>.
A video sitemap entry describes a video on the page named in its parent <loc>. Each URL has a different purpose: <loc> points to the page where visitors watch the video, <video:content_loc> points to the video file, <video:player_loc> points to the embedded video player, and <video:thumbnail_loc> points to the thumbnail image.
Each video entry needs a thumbnail URL, title, description, plus either a video-file URL or a player URL. If you have a direct URL to the video file, use <video:content_loc>; Google recommends it when available. If a platform hosts the video and provides an embed player, use <video:player_loc> when you do not have the file URL. Neither video URL should repeat the URL of the page where visitors watch the video.
https://www.example.com/videos/how-to-assemble
<video>
<video>https://www.example.com/thumbnails/assemble.jpg</video>
<video>How to assemble the chair</video>
<video>A step-by-step assembly guide for the chair.</video>
<video>https://media.example.com/videos/assemble.mp4</video>
</video>
Keep the description within 2,048 characters. Optional fields describe details such as the video's duration, publication date, uploader, or tags. Include these details only when they accurately describe the video. The duration field accepts values from 1 to 28,800 seconds, and each video can have up to 32 tags. Google’s video sitemap documentation lists the supported fields and formats.
A sitemap helps Google find media, but it does not guarantee that Google will crawl or index it. To qualify for video features, the watch page must be indexed. The video must appear on the page, and the page should exist mainly for visitors to watch that video. A page that discusses a subject and also embeds a video does not necessarily qualify.
Google also needs to reach the video and its thumbnail. Use stable URLs. Check that robots.txt rules, login requirements, firewalls, or other access controls do not block Googlebot. If JavaScript loads the video, make sure the finished page shows it without requiring a visitor to click or do anything else. Google’s video SEO guidance explains these page and media requirements.
Keep sitemap metadata current. Google deprecated image fields such as caption, geo_location, title, and license, as well as video fields such as category, gallery_loc, and price. These fields stopped affecting indexing and search features after August 6, 2022. New sitemap generators should leave them out, as explained in Google’s announcement about deprecated tags.
Save sitemap files as UTF-8 XML. Declare the sitemap protocol namespace and escape special characters in text. For example, write an ampersand in a URL as & in the XML file. The Sitemap Protocol describes the file format and URL rules.
If a sitemap exceeds Google’s size limits, split it into multiple files and list them in a sitemap index. A sitemap index can contain up to 50,000 sitemap-location entries. Search Console supports up to 500 sitemap index files per site. These limits apply to indexes, not individual sitemap files. Google explains how sitemap index files work.
Submit the sitemap through Search Console or its API, or add a Sitemap: line to robots.txt. Submission tells Google where to find the sitemap. It does not prove that Google downloaded the file, crawled every URL, indexed the media, or showed it in search. Check the Sitemaps report in Search Console for access or processing errors. Google’s submission instructions describe the available options.
Give Vroni a GitHub issue, bug report, spec, or rough idea. It reads the repo, plans the change, writes code, runs checks, and works toward a review-ready pull request.
Take a look at vroni.com