A
sitemap.xml is an XML file that helps search engines understand the structure of a website. It lists the pages of the site to allow for better indexing. Here are some key elements typically found in a
sitemap.xml:
- URLset: The main container for all URLs in the sitemap.
- URL: Each URL entry contains information about a webpage.
- loc: Specifies the location of the page (the URL).
- lastmod: Indicates the last modification date of the page.
- changefreq: Suggests how frequently the page is likely to change (e.g., daily, weekly).
- priority: Indicates the importance of the page relative to other pages on the site.
An example of a simple
sitemap.xml might look like this:
<?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>
<priority>0.5</priority>
</url>
</urlset>
Having a well-structured
sitemap.xml can enhance SEO and help users navigate the site more effectively.