Rank Math SEO插件是WordPress中非常好用的SEO插件,今天在使用Rank Math SEO插件的时候遇见了一个问题,即在Sitemap Settings中选择将文章标签Include in Sitemap选项开启的时候,访问生成的post_tag-sitemap.xml的标签sitemap链接是404了,其他都是正常的。这种也算”疑难杂症”了,小白还真不好找到原因解决。所以在此记录和分享下原因和解决办法:

导致原因
再网上搜索一番发现原因是:将 tag 页面的 标签 Archives Robots Meta设置为了noindex。
这个时候在开启 tag > Include in Sitemap 访问tag的sitemap链接就是404了。
解决办法
知道了原因就好解决了,我们只需要将标签的 Archives Robots Meta设置为 index 既可以解决了。
Rank Math SEO → Titles & Meta → 左侧内容类型选择:Post: → 标签 → 进入到标签Titles & Meta设置页面
下拉找到:标签 Archives Robots Meta → Index 勾选 → Save Changes(保存)

再去Sitemap Settings中找到标签> Include in Sitemap 开启后在访问,你就会发现正常了。
参考资料
Why the Sitemap_Index.xml is Throwing a 404 Error
相关链接
Rank Math SEO插件 WordPress插件库地址
