sitemap是什么,sitemap格式

2021-02-01 13:39:26

sitemap是一个xml文件,放到站点根目录下面,里面列出网站所有希望被收录的地址,方便搜索引擎搜录网页。

格式如下:

<?xml version=“1.0” encoding=“utf-8”?>
   <!– XML文件需以utf-8编码–>
   <urlset>

  <!--必填-->
   <url>
       <!--必填,定义某一个链接的入口,每一条数据必须要用<url>和</url>来标示 -->
       <loc>http://www.xxxxxx.html/000000.html</loc>
       <!--必填,URL长度限制在256字节内-->
       <lastmod>2012-12-01</lastmod>
       <!--更新时间标签,非必填,用来表示最后更新时间-->
       <changefreq>daily</changefreq>
       <!--更新频率标签,非必填,用来告知引擎页面的更新频率 -->
       <priority>0.8</priority>
       <!--优先权标签,优先权值0.0-1.0,用来告知引擎该条url的优先级-->
   </url>
   <url>
       <loc>http://www.xxxxxx.html/000001.html</loc>
       <lastmod>2012-12-01</lastmod>
       <changefreq>daily</changefreq>
       <priority>0.8</priority>
   </url>

</urlset>

生成完后,在robots.txt里添加sitemap的地址链接

Sitemap: https://pgres.cn/sitemap.xml

然后可以向各大搜索引擎提交sitemap,投递地址如下:

360 http://zhanzhang.so.com/sitetool/sitemap

baidu https://ziyuan.baidu.com/linksubmit/index

搜狗采用邀请制,默认不开放这个功能