sitemap.xml
A sitemap.xml file is an important part of a website that helps search engines understand its structure. Here’s a simple overview of what a sitemap.xml typically includes:
- XML Declaration: Indicates that the file is an XML document.
- URL Set: The root element, usually
<urlset>, that defines the collection of URLs.
- URL Entry: Each URL is enclosed in
<url> tags, which contain:
- loc: The URL of the webpage.
- lastmod: The last modification date of the webpage.
- 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.
Here is a basic example of a sitemap.xml structure:
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap-image">
<url>
<loc>http://www.example.com/</loc>
<lastmod>2023-10-01</lastmod>
<changefreq>daily</changefreq>
<priority>1.0</priority>
</url>
<url>
<loc>http://www.example.com/about</loc>
<lastmod>2023-09-15</lastmod>
<changefreq>monthly</changefreq>
<priority>0.8</priority>
</url>
</urlset>
Creating a well-structured sitemap.xml file can enhance your site's SEO and help search engines index your pages more effectively.