sitemap.xml
A sitemap.xml file is an essential part of a website's SEO strategy. It provides search engines with a structured list of all the pages on a site, enabling better crawling and indexing. Here’s a simple overview of its structure and components:
Basic Structure of sitemap.xml
-
XML Declaration
- Defines the document as an XML file.
-
urlset
- Root element containing all url entries.
-
url
- Each url element represents a specific page on the website.
- Can contain the following child elements:
- loc - URL of the page.
- lastmod - Last modified date of the page.
- changefreq - Frequency of updates (e.g., daily, weekly).
- priority - Priority of the page relative to others.
Example of a sitemap.xml
<?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>weekly</changefreq>
<priority>1.0</priority>
</url>
<url>
<loc>http://www.example.com/about</loc>
<lastmod>2023-09-15</lastmod>
<changefreq>monthly</changefreq>