【问题标题】:Adding Custom Attributes in a Sitemap.xml file在 Sitemap.xml 文件中添加自定义属性
【发布时间】:2014-02-01 21:32:05
【问题描述】:

我有一个面向公众的网站。我正在使用 sitemap.xml 文件告诉搜索引擎我网站上的网址。我还有一些服务器端代码正在读取我的 sitemap.xml 文件。事实证明,我想为每个 <url> 标签添加一些自定义属性。例如,我的 sitemap.xml 文件目前如下所示:

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

<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <url>
    <loc>http://www.ecofic.com/contact</loc>
    <lastmod>2013-06-04</lastmod>
    <changefreq>never</changefreq>
  </url>
</urlset>

我想做以下事情:

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

<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <url>
    <loc>http://www.ecofic.com/contact</loc>
    <lastmod>2013-06-04</lastmod>
    <changefreq>never</changefreq>
    <details author="Joe Smith" title="some title">This is a longer description of about the blog post. This will serve as a preview.</details>
  </url>
</urlset>

我的问题是,这合法吗?我的意思是,搜索引擎会忽略我的自定义标签吗?或者,搜索引擎会只看到我的站点地图,将其视为无效,然后忽略整个文件吗?

谢谢

【问题讨论】:

    标签: xml sitemap


    【解决方案1】:

    自定义标签无效,您只能按照架构定义的方式使用。由于自定义标签,您的站点地图可能会被搜索引擎拒绝。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-08-09
      • 1970-01-01
      • 2012-07-10
      • 1970-01-01
      • 2020-12-20
      • 2017-11-07
      • 2020-07-02
      • 1970-01-01
      相关资源
      最近更新 更多