/templets/default/)新建文件 sitemap.xml。https://yourdomain.com 替換為你的實際域名(含協議,無尾斜槍)。<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="https://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://yourdomain.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='23' type='top'}
<url>
<loc>https://yourdomain.com[field:typelink/]</loc>
<changefreq>daily</changefreq>
<priority>0.8</priority>
</url>
{/dede:channel}
{dede:arclist row='2000' orderby='pubdate'}
<url>
<loc>https://yourdomain.com[field:arcurl/]</loc>
<lastmod>[field:pubdate function=strftime('%Y-%m-%d',@me)/]</lastmod>
<changefreq>monthly</changefreq>
</url>
{/dede:arclist}
</urlset>
{dede:arclist row=1 ...}:獲取最新文章發布時間作為首頁 {dede:channel row='23' type='top'}:遍歷頂級欄目(最多 23 個),生成欄目 URL。{dede:arclist row='2000' ...}:遍歷最新 2000 篇文章(根據實際數據量調整),生成文章 URL 及最後修改時間。https://www.sitemaps.org/schemas/sitemap/0.9,百度、Google 通用。sitemap.xml。/wwwroot/sitemap.xml)。sitemap.xml。
https://yourdomain.com/sitemap.xml,確認 XML 格式正確、鏈接可訪問。https://yourdomain.com/sitemap.xml 提交。index.htm),再次點擊更新主頁即可恢復。row='2000' 為更大值(如 10000),或分多個 sitemap 文件(sitemap1.xml, sitemap2.xml)並建立 sitemap 索引文件。https://yourdomain.com/{dede:field name='typedir'/}/。在服務器添加 crontab,每天凌晨調用生成腳本(需二次開發 PHP 腳本調用 DedeCMS 生成類),或使用百度站長平台「自動提交」JS 代碼配合主動推送。