dedecms网站地图制作xml,一键更新网站内容

 此地图谷歌、百度和其他的搜索引擎通用,属于xml格式,通过编写代码、手动建立dede地图模版,每次网站的内容发布后,dede网站地图也能得到及时更新,一劳永逸!
步骤:
一、在桌面上建立一个记事本,然后把名称改为sitemap.htm。只要后缀名为.htm都可行,这就dede网站地图的模版名字。

二、复制以下代码到刚刚建立的记事本里,也就是sitemap.htm里。

<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.google.com/schemas/sitemap/0.9">
  <url>
    <loc>http://www.2858588003.com</loc>
    <lastmod>{dede:arclist row=1 titlelen=24 orderby=pubdate}
    [field:pubdate function=strftime('%Y-%m-%d',@me)/]
    {/dede:arclist}</lastmod>
    <changefreq>daily</changefreq>
    <priority>1.0</priority>
  </url>
  {dede:channel row='4' type='top'}
  <url>
  <loc>http://www.2858588003.com[field:typelink/]</loc>
  <changefreq>daily</changefreq>
  <priority>0.8</priority>
  </url>
  {/dede:channel}
  {dede:arclist row=50000 orderby=pubdate}
  <url>
    <loc>http://www.2858588003.com[field:arcurl/]</loc>
    <lastmod>[field:pubdate function=strftime('%Y-%m-%d',@me)/]</lastmod>
    <changefreq>monthly</changefreq>
    <priority>0.6</priority>
  </url>
  {/dede:arclist}
</urlset>
说明:把“http://www.2858588003.com”域名换成你自己的网站域名,其 他不动;{dede:channel row='4' type='top'}是网站的目录,也就是你网站的导航栏,数字代表几个目录,有几个就填写几 个,其他不动;{dede:arclist row=50000 orderby=pubdate}是文章页面,也就是详细页面。50000个是一个地图 文件的最大容量数,文件的大小不超过10M,如果超过了要分多个地图文件来存储。

清风明月本无价,近水远山皆有情。
原文地址:https://www.cnblogs.com/onlylove2015/p/4394067.html