# 通过 WordPress 嵌入发布的旧主题缺少 x-robots: noindex 和 canonical 标签

**URL:** <https://meta.discourse.org/t/old-topics-published-via-wordpress-embed-are-missing-x-robots-noindex-and-canonical-tags/403109>\
**Category:** WordPress\
**Tags:** wordpress\
**Created:** [2026年五月15日 21:44 UTC](https://meta.discourse.org/t/old-topics-published-via-wordpress-embed-are-missing-x-robots-noindex-and-canonical-tags/403109 "2026-05-15T21:44:55Z")\
**Posts on this page:** 1\
**Showing post:** 11

<div class="post-metadata">

**Author:** ![Slate](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/slate/32/574156_2.png) [@Slate](https://meta.discourse.org/u/Slate)\
**Post date:** [2026年八月15日 14:43 UTC](https://meta.discourse.org/t/old-topics-published-via-wordpress-embed-are-missing-x-robots-noindex-and-canonical-tags/403109/11 "2026-08-15T14:43:40Z")

</div>

插件做得不错。对于仍需要找出_哪些_现有主题丢失了标头的用户，可以从外部进行检查——无需 Rails，无需数据库：

```plaintext
curl -s https://EXAMPLE.COM/sitemap_1.xml \

```

` | grep -o 'https://[^<]*/t/[^<]*' \`

` | while read -r u; do`

` curl -sI "$u" | grep -qi 'x-robots-tag: *noindex' || echo "$u"`

` done > missing-noindex.txt`

`sitemap.xml` 通常是一个指向子站点地图的索引，因此请先展开它们，然后针对每个子站点地图运行此命令。如果你的网站有限速，请添加 `sleep`。

有一点值得为后来者单独说明：标头和规范链接是两个独立的信号，它们会独立失效——一个主题可能会丢失 `X-Robots-Tag` 但保留正确的规范链接，或者反之。请同时检查两者：

```plaintext
curl -sI URL | grep -i x-robots

```

`curl -s URL | grep -i 'rel="canonical"'`

---

_[View the full topic](https://meta.discourse.org/t/old-topics-published-via-wordpress-embed-are-missing-x-robots-noindex-and-canonical-tags/403109)._
