sitemap.xml
A `sitemap.xml` file is an important tool for search engines. It helps them understand the structure of your website. Here's a simple overview of its components and purpose:
Purpose of sitemap.xml:
- Informs search engines about pages on your site.
- Helps improve indexing of your website.
- Can specify how often pages are updated.
- Indicates the priority of pages relative to each other.
Basic Structure of sitemap.xml:
-
URLSet - The main container for the URLs.
-
URL - Each individual page entry.
- loc - The URL of the page.
- lastmod - The last modified date of the page.
- changefreq - How often the page is likely to change.
- priority - The priority of the page in relation to other pages.
Example of a simple sitemap.xml:
<?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>weekly</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>