Tags
Sitemap
Asked 3 years ago
3 Sep 2021
Views 463
Freeman

Freeman posted

How do I create a sitemap in HTML?

How do I create a sitemap in HTML?
david

david
answered Sep 18 '21 00:00

Sitemap means it gives the site's URL lists to the different search engines.
The search engines can get detail about the link they need to crawl,
so simply list all URL in XML format and name it sitemap.xml.

so what should be the format of the sitemap ?
sample sitemap.xml :

<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <url>
    <loc>http://www.sitemap.com/sitemap.html</loc>
    <lastmod>2021-06-04</lastmod>
  </url>
  <url>
    <loc>http://www.sitemap.com/homepage.html</loc>
    <lastmod>2021-06-04</lastmod>
  </url>
</urlset>


as you see in the above format , <url> attribute contain the <loc> and <lastmod>
in between <loc></loc> put the url and <lastmod> element contain modify date
so you need to repeat <url> element for each url of the website , Thats it is


to get crawled or get noticed your sitemap put it in robot.txt and give the complete URL to search console of the search engine like google search console

in robot.txt, just put the following line (just change to your site URL)
Sitemap.xml: https://www.example.come/sitemap.xml



Post Answer