sitemap.xml
A `sitemap.xml` file is an XML file that helps search engines understand the structure of a website. It lists the URLs of a site along with additional metadata about each URL. Here is a simple overview of its components:
- URL Set: The main container for the URLs, typically wrapped in
<urlset>.
- URL Entry: Each URL is wrapped in
<url> tags.
- loc: The URL of the page, wrapped in
<loc>.
- lastmod: The date the page was last modified, wrapped in
<lastmod>.
- changefreq: How frequently the page is likely to change, wrapped in
<changefreq>.
- priority: The priority of the page relative to other pages on the site, wrapped in
<priority>.
Here is a basic example of a `sitemap.xml` file:
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap-image/1.1">
<url>
<loc>https://www.example.com/</loc>
<lastmod>2023-10-01</lastmod>
<changefreq>daily</changefreq>
<priority>1.0</priority>
</url>
<url>
<loc>https://www.example.com/about</loc>
<lastmod>2023-09-15</lastmod>
<changefreq>monthly</changefreq>
<priority>0.8</priority>
</url>
</urlset>
This structure helps search engines crawl and index the website more effectively.