A `sitemap.xml` file is used to inform search engines about the pages on your site. Here’s a simple overview of its structure and purpose:
- Purpose: Helps search engines crawl your site more effectively.
- Format: XML (eXtensible Markup Language).
- Common elements:
- urlset - The root element of the sitemap.
- url - Represents a single webpage.
- loc - The URL of the webpage.
- lastmod - The last modified date of the webpage.
- changefreq - How frequently the page is likely to change.
- priority - The priority of the page relative to other pages on the site.
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>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-10-01</lastmod>
<changefreq>monthly</changefreq>
<priority>0.8</priority>
</url>
</urlset>
Ensure to update your `sitemap.xml` regularly to reflect any changes on your website.