sitemap.xml
A
sitemap.xml file is an XML file that lists the URLs of a website along with additional metadata about each URL. This helps search engines like Google to crawl the site more effectively. The structure of a typical
sitemap.xml includes:
- urlset: The root element that contains all the URL entries.
- url: A child element for each URL in the sitemap.
- loc: The URL of the web 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 page relative to other pages on the site (range from 0.0 to 1.0).
Here is a simple example of a
sitemap.xml file:
```xml
http://www.example.com/
2023-10-01
monthly
1.0
http://www.example.com/about
2023-09-15
yearly
0.5
```
In this example:
- The first url entry is for the homepage.
- The second url entry is for the "About" page.
Creating a
sitemap.xml helps improve a website's SEO and ensures that search engines can find and index all important pages.