A `sitemap.xml` file is an XML file that lists the URLs for a site along with additional metadata about each URL. This helps search engines like Google to crawl the site more intelligently. Here are some key points about `sitemap.xml`:
- Purpose: To inform search engines about pages on your site that are available for crawling.
- Format: It is written in XML format and follows a specific structure.
- Components:
- URL: The actual web page address.
- Last Modified: The date when the page was last updated.
- Change Frequency: How often the page is likely to change (e.g., daily, weekly).
- Priority: The priority of the page relative to other pages on the site.
- Location: Typically located at yourdomain.com/sitemap.xml.
- Benefits:
- Improves the visibility of your site in search engines.
- Helps search engines discover new or updated content faster.
Here is a simple 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>monthly</changefreq>
<priority>1.0</priority>
</url>
<url>
<loc>http://www.example.com/page1</loc>
<lastmod>2023-09-15</lastmod>
<change