sitemap.xml
A *sitemap.xml* file is an XML file that helps search engines understand the structure of a website. It lists all the important pages on a site to ensure that search engines can index them effectively. Here’s a simple breakdown of its components:
- URL Set: Contains multiple url entries, each representing a page on the website.
- URL Element: Each url entry can include several child elements such as:
- loc: The URL of the page.
- lastmod: The date the page was last modified.
- changefreq: How often the page is likely to change (e.g., daily, weekly).
- priority: The priority of the page relative to other pages on the site (range from 0.0 to 1.0).
- Purpose: Helps improve SEO by ensuring all pages are indexed and discoverable.
- Format: Must be well-formed XML and follow the sitemap protocol.
An example structure of a *sitemap.xml* file looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap-image/1.1">
<url>
<loc>https://www.example.com/</loc>
<lastmod>2023-01-01</lastmod>
<changefreq>monthly</changefreq>
<priority>1.0</priority>
</url>
<url>
<loc>https://www.example.com/about</loc>
<lastmod>2023-01-15</lastmod>
<changefreq>monthly</changefreq>
<priority>0.8</priority>
&