A
sitemap.xml file is an XML file that provides information about the pages, videos, and other files on a site, and the relationships between them. It helps search engines like Google understand your site structure and improve indexing.
Here are some key points about
sitemap.xml:
- Purpose: To inform search engines about the pages on your website that are available for crawling.
- Format: The file is written in XML format, which is structured and machine-readable.
- Location: Typically located in the root directory of the website (e.g., https://www.example.com/sitemap.xml).
- Types of URLs: Can include various types of URLs, such as:
- Frequency and priority: You can specify how often pages are updated and their importance relative to other pages.
To create a basic
sitemap.xml, you might use the following structure:
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap-image/1.1">
<url>
<loc>https://www.example.com/page1</loc>
<lastmod>2023-10-01</lastmod>
<changefreq>monthly</changefreq>
<priority>0.8</priority>
</url>
<url>
<loc>https://www.example.com/page2</loc>
<lastmod>2023-10-02</lastmod>
<changefreq>weekly</changefreq>
<priority>0.7</priority>
</url>
</urlset>
Make sure to regularly update