# Структурированные данные Google для форумов и страниц профилей

**URL:** https://meta.discourse.org/t/google-structured-data-for-forums-and-profile-pages/286762
**Category:** Feature
**Tags:** seo
**Created:** [27.Ноябрь.2023 19:33:43 UTC](https://meta.discourse.org/t/google-structured-data-for-forums-and-profile-pages/286762 "2023-11-27T19:33:43Z")
**Posts on this page:** 1
**Showing post:** 9

<div class="post-metadata">

### Author: ![rrit](https://avatars.discourse-cdn.com/v4/letter/r/b5ac83/32.png) [@rrit](https://meta.discourse.org/u/rrit)
#### Post date: [17.Декабрь.2023 16:21:24 UTC](https://meta.discourse.org/t/google-structured-data-for-forums-and-profile-pages/286762/9 "2023-12-17T16:21:24Z")

</div>

#### 1. `itemprop="text"`

Всегда добавляйте `itemprop="text"` здесь, так как для [DiscussionForumPosting](https://developers.google.com/search/docs/appearance/structured-data/discussion-forum?hl=en) свойство `articleBody` больше не указано (или не указано вообще?).

> <https://github.com/discourse/discourse/blob/6f3c498b83169928aba316246ddc9b5d584c5a0d/app/views/topics/show.html.erb#L87-L89>

#### 2. `mainEntityOfPage`

`mainEntityOfPage` должен устанавливаться только один раз для `DiscussionForumPosting` и никогда для множества `Comment`:  
например, проверяйте условие `post.is_first_post`.

> <https://github.com/discourse/discourse/blob/6f3c498b83169928aba316246ddc9b5d584c5a0d/app/views/topics/show.html.erb#L68-L70>

#### 3. `itemprop="url"`

Добавьте `itemprop="url"` в itemscope для `DiscussionForumPosting`.  
Это гарантирует, что комментарии на подстраницах (`…?page=2`) будут привязаны к основной странице темы.

> <https://github.com/discourse/discourse/blob/6f3c498b83169928aba316246ddc9b5d584c5a0d/app/views/topics/show.html.erb#L37-L38>

```plaintext
<link itemprop="url" href="???">

```

Здесь `post.topic.url` не установлен. Есть ли что-то вроде `@topic_view.url`?

**Важно:** свойство itemprop `url` должно указывать на первую страницу темы в представлении для краулеров:

- например, `https://example.org/t/topic-title/1234`
- а не `https://example.org/t/topic-title/1234?page=2`

См. [DiscussionForumPosting → Рекомендуемые свойства → url](https://developers.google.com/search/docs/appearance/structured-data/discussion-forum?hl=en#dfp)

> **url:** Канонический URL обсуждения. В многостраничных потоках устанавливайте это свойство на URL первой страницы. Для одиночного обсуждения это обычно текущий URL.

---

_[View the full topic](https://meta.discourse.org/t/google-structured-data-for-forums-and-profile-pages/286762)._
