網站地圖主要供搜尋引擎爬蟲抓取,不需華麗介面,只需乾淨的 URL 列表。DEDECMS 內建「自由列表」功能,無需開發專用模組即可輕鬆生成符合百度規範的 sitemap.xml。
進入後台 → 核心 → 頻道模型 → 自由列表管理 → 點擊「增加列表」。

按照下圖填寫關鍵欄位:
{typedir}/sitemap.xmlsitemap.htm(見下文)
將下載的 sitemap.htm 上傳至當前模板目錄(如 /templets/default/)。模板核心代碼如下:
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="https://www.sitemaps.org/schemas/sitemap/0.9">
{dede:arclist typeid='0' row='50000' orderby='pubdate'}<url>
<loc>[field:global.cfg_basehost/][field:arcurl/]</loc>
<lastmod>[field:pubdate function="MyDate('Y-m-d',@me)"/]</lastmod>
<changefreq>daily</changefreq>
<priority>0.8</priority>
</url>{/dede:arclist}
</urlset>
保存自由列表後,返回列表管理頁,點擊該列表後的「更新生成靜態」即可產出 sitemap.xml。日後新增內容只需定期點擊更新,或配合排程任務自動化。

sitemap1.xml, sitemap2.xml),再用 sitemapindex.xml 索引。