A `sitemap.xml` file is an XML file that provides information about the pages, videos, and other files on your site, as well as the relationships between them. It helps search engines like Google to crawl your site more intelligently.
Here’s a simple overview of its structure:
- <?xml version="1.0" encoding="UTF-8"?> - Declares the XML version and encoding.
- <urlset> - The root element that contains all the URLs.
- <url> - Represents a single URL entry.
- <loc> - The location of the URL.
- <lastmod> - The last modification date of the URL.
- <changefreq> - How frequently the content is likely to change.
- <priority> - The priority of the URL relative to other URLs on your site.
- </url> - Closes the URL entry.
- </urlset> - Closes the root element.
Here is an example of a basic `sitemap.xml` file:
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap-image">
<url>
<loc>http://www.example.com/</loc>
<lastmod>2023-10-01</lastmod>
<changefreq>daily</changefreq>
<priority>1.0</priority>
</url>
<url>
<loc>http://www.example.com/about</loc>
<lastmod>2023-09-15</lastmod>
<change