A `sitemap.xml` file is an XML file that provides search engines with information about the pages on a website. Here are some key points about it:
- Purpose: Helps search engines discover and index website content.
- Structure: Contains URLs of a site along with additional metadata.
- Common Tags:
- <url>: Represents a single URL entry.
- <loc>: Specifies the location of the page.
- <lastmod>: Indicates the last modification date of the page.
- <changefreq>: Suggests how frequently the page is likely to change.
- <priority>: Indicates the importance of the page relative to other pages.
- Location: Typically placed in the root directory of the website.
- Submission: Can be submitted to search engines via their webmaster tools.
A basic example of a `sitemap.xml` structure is shown below:
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap-image/1.1">
<url>
<loc>http://www.example.com/</loc>
<lastmod>2023-10-01</lastmod>
<changefreq>monthly</changefreq>
<priority>1.0</priority>
</url>
<url>
<loc>http://www.example.com/about</loc>
<lastmod>2023-09-15</lastmod>
<changefreq>yearly</changefreq>
<priority>0.5</priority>
</url>
</urlset