sitemap.xml
The `sitemap.xml` file is an essential component for search engine optimization (SEO). It helps search engines crawl your website more effectively. Here’s a brief overview of its structure and purpose:
- Purpose: To provide search engines with a list of pages on your site, ensuring all important pages are indexed.
- Format: XML format, which is machine-readable.
- Common Tags:
- <urlset>: The root element that defines the XML namespace.
- <url>: Contains information about a specific URL.
- <loc>: Specifies the 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.
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>http://www.example.com/</loc>
<lastmod>2023-10-01</lastmod>
<changefreq>monthly</changefreq>
<priority>1.0</priority>
</url>
<url>
<loc>http://www.example.com/about</loc>
<lastmod>2023-09-15</lastmod>
<changefreq>yearly</changefreq>
<priority>0.8</priority>
</url>
</urlset>