A
sitemap.xml file is an XML document that provides search engines with information about the pages on a website. It helps improve the indexing of a site by listing all its important URLs. Here are some key points about sitemaps:
- Purpose: To inform search engines about the structure of your website.
- Format: Written in XML, which makes it machine-readable.
- Content: Typically includes:
- URL: The web address of the page.
- Last Modified: The date the page was last updated.
- Change Frequency: How often the page is expected to change.
- Priority: The importance of the page relative to other pages on the site.
- Benefits: Helps improve SEO by ensuring that all pages are indexed and can be discovered by search engines.
- Submission: Can be submitted directly to search engines via their webmaster tools.
To create a basic
sitemap.xml, you would structure it like this:
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap-image">
<url>
<loc>https://www.example.com/</loc>
<lastmod>2023-10-01</lastmod>
<changefreq>monthly</changefreq>
<priority>1.0</priority>
</url>
<url>
<loc>https://www.example.com/page1</loc>
<lastmod>2023-09-15</lastmod>
<changefreq>weekly</changefreq>
<priority>0.8</priority>
</url>
</urlset>