A
sitemap.xml file is an XML document that helps search engines understand the structure of a website and find its pages. Here are some key points about it:
- Purpose: To provide search engines with a roadmap of the website's content.
- Format: An XML file containing URLs of the website.
- Benefits:
- Improves indexing of pages.
- Helps discover new or updated content.
- Provides metadata about pages, such as last modified date and priority.
- Location: Typically found at www.example.com/sitemap.xml.
- Submission: Can be submitted to search engines via their webmaster tools.
To create a basic
sitemap.xml, you can use the following 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/page1</loc>
<lastmod>2023-10-01</lastmod>
<changefreq>monthly</changefreq>
<priority>0.8</priority>
</url>
<url>
<loc>http://www.example.com/page2</loc>
<lastmod>2023-10-02</lastmod>
<changefreq>weekly</changefreq>
<priority>0.7</priority>
</url>
</urlset>
Make sure to update your
sitemap.xml regularly to reflect changes in your site's structure and content.