sitemap.xml
A `sitemap.xml` file is an XML file that helps search engines understand the structure of your website. It lists the pages on your site to ensure that search engines can discover and index them effectively. Here are some key components of a `sitemap.xml`:
- URL Set: The main structure of the sitemap, typically enclosed in
<urlset> tags.
- URL Entry: Each page is represented by a
<url> tag, inside which you can specify various details.
- Loc: The location of the page, specified in a
<loc> tag.
- Last Modified: Optional; indicates when the page was last modified, specified in a
<lastmod> tag.
- Change Frequency: Optional; suggests how often the page is likely to change, specified in a
<changefreq> tag.
- Priority: Optional; indicates the importance of the page relative to other pages, specified in a
<priority> tag.
Here is a basic example of a `sitemap.xml` structure:
<?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>