A `sitemap.xml` file is an XML file that helps search engines understand the structure of your website. It lists all the important pages to ensure they are crawled and indexed effectively. Here’s a simple overview of its structure:
- <?xml version="1.0" encoding="UTF-8"?> - Declaration of the XML version and encoding.
- <urlset> - The root element that contains all the URLs.
- <url> - Each URL entry in the sitemap.
- <loc> - The location (URL) of the page.
- <lastmod> - The last modified date of the page.
- <changefreq> - How often the page is likely to change (e.g., daily, weekly).
- <priority> - The priority of the page relative to other pages on the site.
- </urlset> - Closing tag for the root element.
Here’s a basic example of a `sitemap.xml` file:
http://www.example.com/
2023-10-01
monthly
1.0
http://www.example.com/about
2023-10-01
yearly
0.8
This format helps search engines navigate your website efficiently, improving your site's SEO.