WordPress 5.5 中的网站地图 Sitemap 功能
<p style="border: 0px; font-family: Source Sans Pro, sans-serif; font-size: 14px; margin-top: 0px; margin-bottom: 1em; outline: 0px; padding: 0px; vertical-align: baseline; line-height: 1.625em; color: rgb(55, 55, 55); white-space: normal; background-color: rgb(255, 255, 255);"><a href="https://cnzhx.net/blog/wordpress-5-5-eckstine-released/" style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline; color: rgb(29, 153, 243); text-decoration-line: none; overflow-wrap: break-word; overflow: hidden;">WordPress 5.5</a> 中整合了新的站点地图(sitemap)功能。站点地图可以让搜索引擎更好地理解网站的结构,更方便地发现网站上的新内容和重要内容。现在 WordPress 默认在站点发布之时就提供一个 XML 格式的站点地图。</p><p style="border: 0px; font-family: Source Sans Pro, sans-serif; font-size: 14px; margin-top: 0px; margin-bottom: 1em; outline: 0px; padding: 0px; vertical-align: baseline; line-height: 1.625em; color: rgb(55, 55, 55); white-space: normal; background-color: rgb(255, 255, 255);"><span id="more-8858" style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"></span>站点地图功能大家应该也很熟悉。大名鼎鼎的 sitemap 插件 Google XML Sitemaps(原 <a href="https://cnzhx.net/blog/wp-multisite-sitemaps-plugin/" style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline; color: rgb(29, 153, 243); text-decoration-line: none; overflow-wrap: break-word; overflow: hidden;">Google (XML) Sitemaps Generator for WordPress</a>) 相信很多人都用过。当初水景一页<a href="https://cnzhx.net/blog/google-xml-sitemaps-and-wordpress-multisite/" style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline; color: rgb(29, 153, 243); text-decoration-line: none; overflow-wrap: break-word; overflow: hidden;">更新到多站点模式的时候还遇到问题了</a>。现在,更新到 WordPress 5.5 之后,这类插件是否还需要保留就得看各自的需求了。</p><p style="border: 0px; font-family: Source Sans Pro, sans-serif; font-size: 14px; margin-top: 0px; margin-bottom: 1em; outline: 0px; padding: 0px; vertical-align: baseline; line-height: 1.625em; color: rgb(55, 55, 55); white-space: normal; background-color: rgb(255, 255, 255);">WordPress 5.5 中,默认的网站地图地址是 <code style="border: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; line-height: normal; font-family: Source Code Pro, monospace; margin: 0.1em 0px; outline: 0px; padding: 0.2em 0.3em; vertical-align: baseline; background: rgb(238, 238, 238);">/wp-sitemap.xml</code>。例如,水景一页的网站地图 <a href="https://cnzhx.net/wp-sitemap.xml" style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline; color: rgb(29, 153, 243); text-decoration-line: none; overflow-wrap: break-word; overflow: hidden;">https://cnzhx.net/wp-sitemap.xml</a>。打开后可以参考如下的页面内容,</p><pre style="border-width: 0px 0px 0px 2px; border-top-style: initial; border-right-style: initial; border-bottom-style: initial; border-left-style: solid; border-top-color: initial; border-right-color: initial; border-bottom-color: initial; border-left-color: rgb(128, 9, 24); border-image: initial; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 14px; line-height: 1.5; font-family: Source Code Pro, monospace; margin-top: 0px; margin-bottom: 1.625em; outline: 0px; padding: 0px 1.625em; vertical-align: baseline; background-color: rgb(244, 244, 244); overflow: auto; color: rgb(55, 55, 55);">XML SitemapThis XML Sitemap is generated by WordPress to make your content more visible for search engines.
Learn more about XML sitemaps.
Number of URLs in this XML Sitemap: 5.
URL
https://cnzhx.net/wp-sitemap-posts-post-1.xml
https://cnzhx.net/wp-sitemap-posts-page-1.xml
https://cnzhx.net/wp-sitemap-taxonomies-category-1.xml
https://cnzhx.net/wp-sitemap-taxonomies-post_tag-1.xml
https://cnzhx.net/wp-sitemap-users-1.xml</pre><p style="border: 0px; font-family: Source Sans Pro, sans-serif; font-size: 14px; margin-top: 0px; margin-bottom: 1em; outline: 0px; padding: 0px; vertical-align: baseline; line-height: 1.625em; color: rgb(55, 55, 55); white-space: normal; background-color: rgb(255, 255, 255);">很显然,WordPress 将文章、页面、分类、标签和用户各建了一个子地图页面。将其与水景一页当前使用的 Google XML Sitemaps 提供的网站地图 <a href="https://cnzhx.net/sitemap.xml" style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline; color: rgb(29, 153, 243); text-decoration-line: none; overflow-wrap: break-word; overflow: hidden;">https://cnzhx.net/sitemap.xml</a> 相对比就能看出来区别,</p><ul style="list-style-type: circle;" class=" list-paddingleft-2"><li><p>WordPress 5.5 中的网站地图还比较原始,过于简陋,缺乏一些现代化的功能。</p></li><li><p>还不能提供自定义加入的页面,当然不排除以后会有人开发提供自定义功能的插件,毕竟 WordPress 已经预留了自定义 WP-sitemap 的接口。</p></li><li><p>将所有文章挤在一个专门的文章类 sitemap 中也会给文章数量很大的网站造成困难。我们知道,当一个页面中条目数量过大时就会带来处理效率的问题。不知道 WordPress 是否为此设定了调整机制,比如条目数目大于 1000 时就再增加一个新的 <code style="border: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; line-height: normal; font-family: Source Code Pro, monospace; margin: 0.1em 0px; outline: 0px; padding: 0.2em 0.3em; vertical-align: baseline; background: rgb(238, 238, 238);">/wp-sitemap-posts-post-2.xml</code>。想来应该是会有类似的考虑。</p></li></ul><p><br/></p><link rel="stylesheet" href="//www.zhidianyun.cn/source/plugin/wcn_editor/public/wcn_editor_fit.css?v134_TZ8" id="wcn_editor_css"/>
页:
[1]