sitemap.xml
A `sitemap.xml` is an XML file that helps search engines understand the structure of a website. It contains a list of URLs for a site along with additional metadata about each URL. Here are some key points about a `sitemap.xml`:
- Purpose: Helps search engines crawl a site more intelligently.
- Format: Written in XML format.
- Common Elements:
- url: Represents a single URL.
- loc: The location of the URL.
- lastmod: The date the URL was last modified.
- changefreq: How often the URL is likely to change.
- priority: The priority of the URL relative to other URLs on the site.
- Benefits:
- Improves indexing by search engines.
- Informs search engines of new or updated content.
- Aids in the discovery of pages that might not be easily found through links.
To create a basic `sitemap.xml`, you can follow this 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>monthly</changefreq>
<priority>1.0</priority>
</url>
<url>
<loc>http://www.example.com/about</loc>
<lastmod>2023-09-15</lastmod>
<changefreq>yearly</changefreq>
<