+
80
-

sitemap.xml中url过大超过5万条怎么办?

sitemap.xml中url过大超过5万条怎么办?

网友回复

+
0
-

可以生成多个sitemap文件,多个sitemap文件在robots.txt中按行分割如下:

User-agent: *
Sitemap: https://www.example.com/sitemap1.xml
Sitemap: https://www.example.com/sitemap2.xml

+
0
-

可以在sitemap.xml中拆分成多个sitemap文件,示例如下:

<?xml version="1.0" encoding="UTF-8"?>
<sitemapindex>
<sitemap>
<loc>http://www.example.com/sitemap_1.xml</loc>
<lastmod>2021-10-09</lastmod>
</sitemap><sitemap>
<loc>http://www.example.com/sitemap_2.xml</loc>
<lastmod>2021-10-09</lastmod>
</sitemap>
</sitemapindex>

我知道答案,我要回答