A `sitemap.xml` file is an XML file that lists the pages of a website to inform search engines about its structure. It helps improve SEO by ensuring that search engines can find and index all relevant pages.
Here’s a simple breakdown of its components:
- XML Declaration: Indicates that the document is an XML file.
- URL Entries: Each URL entry contains information about a specific page.
- Common Tags:
- <url>: Wraps each URL entry.
- <loc>: Specifies the location (URL) of the page.
- <lastmod>: Indicates the last modification date of the page.
- <changefreq>: Suggests how frequently the page is likely to change.
- <priority>: Indicates the priority of the page relative to other pages on the site.
Here is a simple example of a `sitemap.xml`:
<?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-10-01</lastmod>
<changefreq>monthly</changefreq>
<priority>0.8</priority>
</url>
</urlset>
This file should be placed in the root directory of your website, making it