Add option to set canonical_url to embed_url

From time to time we get requests to set the canonical URL of embedded topics to the URL of the blog post. I’ve created a pull request that does exactly that. It unconditionally uses the URL of the original blog post (embed_url) as canonical for the topic.

There have been various previous discussions like Google indexed link not pointing to the correct post and Duplicate Content in the past.

After reading those posts I’m not so sure about my solution anymore, so I’d like to get some feedback from you.

  • Should this be a configurable? Is there a good reason for keeping the current behavior of always using the topic’s URL as canonical?

  • Should the blog post’s URL only be used as canonical for N pages presented to the search bot? After all, only a certain amount of posts is embedded in the blog post. (N probably should be 1)

I’d appreciate your feedback on this. I’m sure there are lots of different use cases out there and I’d like to make an informed decision before I change anything that could affect search engines.

7개의 좋아요

My thought is that if you are copying and re-posting content from a Blog post for any reason conversation or not, the original blog post is the original content and should be pointed to canonically as the original content.

Yes. And by default don’t enable the blog post’s URL as canonical. Let the customer set the switch. Otherwise this is going to change a lot of Search referral traffic all of a sudden.

IMHO, only the blog post linking top post should be made canonical. The responses and follow ups should not be.

1개의 좋아요

With the WordPress plugin, sites can choose between publishing an excerpt, or publishing the full post to Discourse. Sites that are only publishing an excerpt might not want the canonical URL set to the blog post.

IMO it should be a per host setting here, default off:

3개의 좋아요

That’s not possible. Discourse presents topics as paginated content to crawlers. That’s why I suggested to change only the canonical of the first page.

Yeah, I’m going to make this a per host setting.
@simon Will this work for the Wordpress plugin as well?

Yes, that should work. When a post is published from WordPress it creates a TopicEmbed on Discourse, with the embed_url set to the post’s permalink.

We just got to be careful here… this is a very sharp instrument. If for example wordpress is in “Top N” mode where it show only the best content we can end up setting a canonical to a page that does not have all the overlapping content, this is terrible signal to search engines and can be penalised heavily.

In fact, the whole “collapsing” of OP may make this a bad idea, the OP really should be a complete duplicate of the canonical page, so we may need a different technique there that collapses on client side.

I would not rush anything here.

3개의 좋아요

Howdy folks :wave:

I originally wanted to weigh in here and join in the calls for this feature, but after diving in a bit deeper I wanted to share what I learned about how this works (in case anyone missed it like I did initially!)

We’ve just embedded Discourse as the comment system for our blog and I had a little mini freak out when I clicked the “Show full post…” button and saw the whole blog copied without the correct canonical URL :flushed:

After taking a few deep breaths I went into my “debug mode” and started checking the straight HTML response and checked how much of the post is actually there. As it turns out only the initial paragraph is included in the HTML and therefore this is all Google will see. Phew!

Having a second look at it, it makes perfect sense in the way the UX is laid out. I’m assuming the reason it’s hidden behind a button is because you want people to be able to read the full post and not affect SEO :+1:

I guess initially I was surprised that that “Show full Post…” wasn’t just a link to the original blog :thinking: but I guess it’s an OK way to do it :joy:

9개의 좋아요

이 기능은 이제 embed set canonical url 사이트 설정을 통해 구현되었습니다. 해당 설정은 기본적으로 비활성화되어 있습니다. 활성화하면 임베드된 토픽의 canonical URL이 임베드된 콘텐츠의 URL로 설정됩니다.

이 기능은 이미 한동안 존재해 왔습니다. 해당 설정을 활성화한 사이트에서 SEO 랭킹에 어떤 영향을 미쳤는지 의견을 들려주시면 좋겠습니다.

6개의 좋아요

안녕하세요 @simon, 커뮤니티에서 특정 주제에 대해 canonical URL을 설정하는 방법에 대한 해결책을 찾다가 이 게시물을 발견했습니다.

이 설정이 해결책이 될 수 있을 것 같지만, "임베드된 주제(embedded topics)"가 무엇인지 이해가 되지 않습니다. 이 커뮤니티에서 관련 설명을 찾아보았지만 찾을 수 없었습니다. 아마도 매우 기본적인 내용일 수도 있지만, 임베드된 주제가 무엇인지 또는 Discourse 커뮤니티에서 주제를 임베드하는 방법에 대해 알려주실 수 있을까요?

임베드된 주제란 embed_url 속성이 외부 사이트의 URL로 설정된 주제를 말합니다. 이 방식은 주제가 API를 통해 Discourse에 게시될 때만 사용되는 것으로 알고 있습니다. 예를 들어, Discourse WordPress 플러그인과 Discourse 자바스크립트 임베드 코드는 모두 임베드된 주제를 생성합니다.

외부 사이트에서 주제를 Discourse로 게시하고 있다면 이 방식이 적절할 수 있습니다. 그러나 Discourse에서 직접 생성된 주제에는 이 방식을 사용할 수 없습니다.

3개의 좋아요

블로그 게시물의 제목을 변경할 때(예: SEO를 위해 업데이트 날짜를 포함하는 경우) 또는 중복 콘텐츠를 피하기 위해 이 기능을 사용할 수 있을까요?

우리는 Drupal에서 임베드 콘텐츠를 사용하고 있어서 정말로 이 기능이 필요합니다. 그리고 이 스레드는 처음 들어와서요 :neutral_face: