A `sitemap.xml` file is used to inform search engines about pages on a website that are available for crawling. It helps improve the site's SEO by ensuring that all relevant pages are indexed.
Here are some key components of a `sitemap.xml`:
- URL Set: This is the main container for all URLs listed in the sitemap.
- URL: Each URL entry includes specific tags to provide details about that page.
- Loc: The URL of the page.
- Lastmod: The date the page was last modified.
- Changefreq: How frequently the page is likely to change (e.g., always, hourly, daily, weekly, monthly, yearly, never).
- Priority: The priority of the page relative to other pages on the site (value between 0.0 and 1.0).
A basic example of a `sitemap.xml` file looks like this:
<?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>
<changefreq>monthly</changefreq>
<priority>0.8</priority>
</url>
</urlset>
Make sure to update your `s