A sitemap.xml file is an XML file that lists the URLs for a website along with important metadata about each URL. This helps search engines crawl the site more effectively. Here’s a simple breakdown of its structure and elements:
- XML Declaration: Indicates that the file is an XML document.
- urlset: The root element that contains all the URL entries.
- url: Each URL entry is enclosed in a url tag.
- loc: Specifies the URL of the page.
- lastmod: Indicates the last modification date of the page.
- changefreq: Suggests how frequently the page is likely to change (e.g., daily, weekly).
- priority: Indicates the priority of the page relative to other pages on the site (scale from 0.0 to 1.0).
Here is a basic example of a sitemap.xml file:
http://www.example.com/
2023-10-01
monthly
1.0
http://www.example.com/about
2023-09-15
yearly
0.5
Including a sitemap.xml file on your website can improve your site's SEO by helping search engines discover and index your content more efficiently.