sitemap.xml
A `sitemap.xml` file is an XML document that provides search engines with information about the pages on a website. It helps search engines understand the structure of the site and improve indexing. Here’s a simple overview of its components:
- XML Declaration: Indicates that the document is an XML file.
- URL Set: Contains a list of URLs that the website wants to be indexed.
- URL Element: Each URL is enclosed within
<url> tags.
- Loc: Specifies the location of the URL within
<loc> tags.
- Last Modified: Indicates the last time the URL was modified within
<lastmod> tags.
- Change Frequency: Suggests how often the content changes within
<changefreq> tags.
- Priority: Indicates the priority of the URL relative to other URLs on the site within
<priority> tags.
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/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-15</lastmod>
<changefreq>monthly</changefreq>
<priority>0.8</priority>
</url>
</urlset>