sitemap.xml
A `sitemap.xml` file is an XML file that lists the URLs of a website along with additional metadata about each URL. This helps search engines like Google to crawl the site more effectively. Here are some key points about `sitemap.xml`:
- Purpose: To inform search engines about the pages on your site that are available for crawling.
- Structure: The file is written in XML format and includes the following elements:
- urlset: The root element that contains all the url entries.
- url: Each URL entry that you want to include in the sitemap.
- loc: The location (URL) of the web page.
- lastmod: The date when the page was last modified.
- changefreq: How frequently the page is likely to change (e.g., daily, weekly).
- priority: The priority of the page relative to other pages on the site (from 0.0 to 1.0).
- Example:
-
<?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>
</urlset>