如何创建sitemap.xml以告知Googlebot抓取更新的内容?

时间:2015-06-05 10:25:42

标签: php mysql xml rss sitemap

我的网站上有网址,显示最近更新的链接。

www.example.com/recent_update_post

在此页面中,它包含大约100个链接,具体取决于每次更新的帖子数量,以及我第一次使用网站地图。

所以我的问题是,这样做Google会抓取www.example.com/recent_update_post以及页面中的整个链接吗?

<?xml version="1.0" encoding="UTF-8"?>

<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">

   <url>

      <loc>www.example.com/recent_update_post</loc>

      <changefreq>hourly</changefreq>

      <priority>0.8</priority>

   </url>

</urlset> 

如果没有,这意味着每当我的内容发生变化时,我必须动态创建xml文件吗?

<?xml version="1.0" encoding="UTF-8"?>

<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">

   <url>

      <loc>www.example.com/post/1</loc>

      <lastmod>2005-01-01</lastmod>

      <changefreq>hourly</changefreq>

      <priority>0.8</priority>

   </url>

   <url>

      <loc>www.example.com/post/2</loc>

      <lastmod>2005-01-01</lastmod>

      <changefreq>hourly</changefreq>

      <priority>0.8</priority>

   </url>

   ...


   <url>

      <loc>www.example.com/post/100</loc>

      <lastmod>2005-01-01</lastmod>

      <changefreq>hourly</changefreq>

      <priority>0.8</priority>

   </url>

</urlset> 

1 个答案:

答案 0 :(得分:0)

使用此https://github.com/pawelantczak/php-sitemap-generator 此类可用于生成站点地图并通知搜索引擎的更新。