A sitemap.xml file is an essential component for search engine optimization (SEO) and helps search engines understand the structure of your website. Here’s a basic overview of what a sitemap.xml file includes:
- XML Format: The file is written in XML, a markup language that is both human-readable and machine-readable.
- URL Entries: Each URL entry in the sitemap is defined using the url tag.
- Important Tags:
- loc: Specifies the URL of the page.
- lastmod: Indicates the last modified date of the page.
- changefreq: Suggests how often the page is likely to change (e.g., daily, weekly).
- priority: Indicates the priority of the page relative to other pages on the site (from 0.0 to 1.0).
Here’s a simple example of a sitemap.xml file:
https://www.example.com/
2023-10-01
weekly
1.0
https://www.example.com/about
2023-09-29
monthly
0.8
https://www.example.com/contact
2023-09-15
yearly
0.5
This file should be placed in the root directory of your website, typically accessible via
https://www.example.com/sitemap.xml. Submitting your