sitemap.xml
A `sitemap.xml` file is used to inform search engines about pages on a website that are available for crawling. Here’s a simple breakdown of its structure and use:
Basic Structure of sitemap.xml:
- urlset: The root element that wraps all URLs.
- url: A child element for each URL in the sitemap.
- 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).
- priority: The priority of the URL relative to other URLs on the site (value between 0.0 and 1.0).
Example of a simple sitemap.xml:
http://www.example.com/
2023-10-01
weekly
1.0
http://www.example.com/about
2023-09-15
monthly
0.8
How to Use:
- Place the `sitemap.xml` file in the root directory of your website.
- Submit the sitemap URL to search engines via their webmaster tools.
- Regularly update the sitemap as you add or modify content on your site.
Using a `sitemap.xml` helps improve SEO by making it easier for search engines to discover and index your site's pages.