A `sitemap.xml` file is an XML file that provides search engines with information about the pages on your website. It helps them understand the structure of your site and index it more effectively. Here’s a basic overview of its elements:
- URL - Each page on your site that you want indexed.
- Last Modified - The date when the page was last updated.
- Change Frequency - How often the page is likely to change (e.g., daily, weekly).
- Priority - The priority of the page in relation to other pages on your site (0.0 to 1.0).
Here’s an example of a simple `sitemap.xml` structure:
<?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>daily</changefreq>
<priority>1.0</priority>
</url>
<url>
<loc>http://www.example.com/about</loc>
<lastmod>2023-09-20</lastmod>
<changefreq>monthly</changefreq>
<priority>0.8</priority>
</url>
</urlset>
Make sure to update your `sitemap.xml` file whenever you add, remove, or change pages on your website to keep search engines informed.