A `sitemap.xml` file is used to inform search engines about pages on your site that are available for crawling. Here’s a simple outline of its purpose and structure:
Purpose of sitemap.xml:
- Helps search engines index your website more effectively.
- Can include metadata about each URL, such as last modified date and priority.
- Supports better SEO practices by making sure all pages are discoverable.
Basic Structure of a sitemap.xml:
http://www.example.com/
2023-10-01
monthly
1.0
http://www.example.com/about
2023-09-15
monthly
0.8
http://www.example.com/contact
2023-09-20
yearly
0.5
Key Elements:
- loc: The URL of the page.
- lastmod: The date the page was last modified.
- changefreq: How frequently the page is likely to change (e.g., daily, weekly, monthly).
- priority: The priority of the page relative to other pages on the site (0.0 to 1.0).
Keep the sitemap updated as you add or remove pages to ensure search engines have the latest information about your site.