# Canonical tag on topic URL

**URL:** https://meta.discourse.org/t/canonical-tag-on-topic-url/57057
**Category:** Bug
**Created:** [February 7, 2017, 12:06pm UTC](https://meta.discourse.org/t/canonical-tag-on-topic-url/57057 "2017-02-07T12:06:35Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![CosM](https://avatars.discourse-cdn.com/v4/letter/c/a8b319/32.png) [@CosM](https://meta.discourse.org/u/CosM)
#### Post date: [February 7, 2017, 12:06pm UTC](https://meta.discourse.org/t/canonical-tag-on-topic-url/57057/1 "2017-02-07T12:06:35Z")

</div>

Hi ,

Google the past few weeks is complaining about `URL errors` .

Figured out that the content of e.g `some.forum.com/topic-title/topic-number?page=4` contains 20 posts, from 60th to 80th.  
So assuming that this topic has 61 posts, Google “detects” a `some.forum.com/topic-title/topic-number?page=5` url, thus a 404 page.

What I was not able to figure out is **when** and **why** this is happening, because it does not happen for all topics but for quite a few of them.

Is this a known issue ?

Thanks,  
CosM

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [February 7, 2017, 1:57pm UTC](https://meta.discourse.org/t/canonical-tag-on-topic-url/57057/3 "2017-02-07T13:57:40Z")

</div>

Can you reproduce this issue here or on [try](https://try.discourse.org)?

---

<div class="post-metadata">

### Author: ![CosM](https://avatars.discourse-cdn.com/v4/letter/c/a8b319/32.png) [@CosM](https://meta.discourse.org/u/CosM)
#### Post date: [February 7, 2017, 2:08pm UTC](https://meta.discourse.org/t/canonical-tag-on-topic-url/57057/4 "2017-02-07T14:08:27Z")

</div>

Thanks for your reply !

So if I try `https://try.discourse.org/t/is-the-second-amendment-still-relevant-today/291?page=2` redirects to the 20th post on the topic.  
If i try `https://try.discourse.org/t/is-the-second-amendment-still-relevant-today/291?page=3` I get a `404` .  
Both the above are surely the expected outcomes.

The actual problem is that Google somehow detects that extra page (on the above example it would detect a `https://try.discourse.org/t/is-the-second-amendment-still-relevant-today/291?page=3` ) and then it is complaining that the webpage has URL errors.

Thanks,  
CosM

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [February 7, 2017, 2:09pm UTC](https://meta.discourse.org/t/canonical-tag-on-topic-url/57057/5 "2017-02-07T14:09:57Z")

</div>

I understand the issue, but unless you can provide us with a reproduction, there’s not much we can do I’m afraid 😉

---

<div class="post-metadata">

### Author: ![CosM](https://avatars.discourse-cdn.com/v4/letter/c/a8b319/32.png) [@CosM](https://meta.discourse.org/u/CosM)
#### Post date: [February 7, 2017, 2:20pm UTC](https://meta.discourse.org/t/canonical-tag-on-topic-url/57057/6 "2017-02-07T14:20:49Z")

</div>

Hi,

The above example is a realtime reproduction,this is exactly what is happening.

Thanks,  
CosM

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [February 7, 2017, 2:25pm UTC](https://meta.discourse.org/t/canonical-tag-on-topic-url/57057/7 "2017-02-07T14:25:09Z")

</div>

I’m not seeing any links that points to `https://try.discourse.org/t/is-the-second-amendment-still-relevant-today/291?page=3`.

* * *

_EDIT:_ could it be related to this?

[https://meta.discourse.org/t/the-c-category-name-l-latest-page-1-pages-should-not-be-in-serp/56881/13?u=zogstrip](https://meta.discourse.org/t/the-c-category-name-l-latest-page-1-pages-should-not-be-in-serp/56881/13)

---

<div class="post-metadata">

### Author: ![cpradio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cpradio/32/4970_2.png) [@cpradio](https://meta.discourse.org/u/cpradio)
#### Post date: [February 7, 2017, 2:28pm UTC](https://meta.discourse.org/t/canonical-tag-on-topic-url/57057/8 "2017-02-07T14:28:55Z")

</div>

> [@zogstrip](#):
>
> EDIT: could it be related to this?

I’m not sure. I viewed topics, but didn’t see the next page link on the last page like I do on the Category views. I see a previous page on the last page, which would be expected.

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [February 7, 2017, 2:30pm UTC](https://meta.discourse.org/t/canonical-tag-on-topic-url/57057/9 "2017-02-07T14:30:53Z")

</div>

I was thinking maybe @CosM was describing your issue instead. (_Since I can’t reproduce it_)

---

<div class="post-metadata">

### Author: ![cpradio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cpradio/32/4970_2.png) [@cpradio](https://meta.discourse.org/u/cpradio)
#### Post date: [February 7, 2017, 2:32pm UTC](https://meta.discourse.org/t/canonical-tag-on-topic-url/57057/10 "2017-02-07T14:32:09Z")

</div>

Maybe, but the issue I repro’d doesn’t produce a 404. It simply shows a blank page. It could be that google is simply trying to verify they made it to the last page in a topic when indexing and thus going to a page that doesn’t exist… Not sure why they’d do that though.

---

<div class="post-metadata">

### Author: ![CosM](https://avatars.discourse-cdn.com/v4/letter/c/a8b319/32.png) [@CosM](https://meta.discourse.org/u/CosM)
#### Post date: [February 7, 2017, 2:40pm UTC](https://meta.discourse.org/t/canonical-tag-on-topic-url/57057/11 "2017-02-07T14:40:10Z")

</div>

No this is not relevant.

@cpradio is probably correct.

Thanks,  
CosM

---

<div class="post-metadata">

### Author: ![cpradio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cpradio/32/4970_2.png) [@cpradio](https://meta.discourse.org/u/cpradio)
#### Post date: [February 7, 2017, 2:43pm UTC](https://meta.discourse.org/t/canonical-tag-on-topic-url/57057/12 "2017-02-07T14:43:23Z")

</div>

Yeah, so more info on this, I’d guess that Googlebot is guessing the next possible URL based on the canonical URL. (this is all hypothetical)

When I visit [Is the Second Amendment still relevant today? - general - Discourse Demo](https://try.discourse.org/t/is-the-second-amendment-still-relevant-today/291), as Googlebot, I see a canonical URL of `<link rel="canonical" href="http://try.discourse.org/t/is-the-second-amendment-still-relevant-today/291" />`

When I visit [Is the Second Amendment still relevant today? - Page 2 - general - Discourse Demo](https://try.discourse.org/t/is-the-second-amendment-still-relevant-today/291?page=2), as Googlebot, I see a canonical URL of `<link rel="canonical" href="http://try.discourse.org/t/is-the-second-amendment-still-relevant-today/291?page=2" />`

If I try to visit [Is the Second Amendment still relevant today? - Page 2 - general - Discourse Demo](https://try.discourse.org/t/is-the-second-amendment-still-relevant-today/291?page=3), I get a 404.

So if Googlebot does try to guess the next page to make sure it indexes them all, the 404 is a good indication to it that it did.

---

<div class="post-metadata">

### Author: ![cpradio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cpradio/32/4970_2.png) [@cpradio](https://meta.discourse.org/u/cpradio)
#### Post date: [February 7, 2017, 2:59pm UTC](https://meta.discourse.org/t/canonical-tag-on-topic-url/57057/13 "2017-02-07T14:59:41Z")

</div>

@CosM, I have one other theory. By chance does the topic in question have any deleted posts, and if so, how many?

Could there at one point have actually been a `?page=3`, and then posts were deleted, thus making it only 2 pages now?

---

<div class="post-metadata">

### Author: ![CosM](https://avatars.discourse-cdn.com/v4/letter/c/a8b319/32.png) [@CosM](https://meta.discourse.org/u/CosM)
#### Post date: [February 7, 2017, 3:05pm UTC](https://meta.discourse.org/t/canonical-tag-on-topic-url/57057/14 "2017-02-07T15:05:54Z")

</div>

Thanks for that @cpradio.  
What you are saying here makes sense but:

1. I am wondering why it targets some topics only and not every single topic that has e.g 22 or 36 or 86 posts ?

2. What has changed and it started complaining the past few weeks ?

Edit: I have thought about your theory too but I believe is very unlikely that happened. Is there any way I can find out if a post has been deleted ?

Thanks,  
CosM

---

<div class="post-metadata">

### Author: ![cpradio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cpradio/32/4970_2.png) [@cpradio](https://meta.discourse.org/u/cpradio)
#### Post date: [February 7, 2017, 3:29pm UTC](https://meta.discourse.org/t/canonical-tag-on-topic-url/57057/15 "2017-02-07T15:29:56Z")

</div>

> [@CosM](#):
>
> I am wondering why it targets some topics only and not every single topic that has e.g 22 or 36 or 86 posts ?

That is why I’m leaning on deleted posts. As page 3 may have existed two days ago, but now it doesn’t and when Googlebot returns it is trying to update itself on the contents of page 3 which is no longer applicable. Again, pure theory.

> [@CosM](#):
>
> Edit: I have thought about your theory too but I believe is very unlikely that happened. Is there any way I can find out if a post has been deleted ?

As to how to tell if a topic has deleted posts, open the topic, navigate to the very last post. Take note of the post number count in the timeline (example, this topic, it should be 14), click on the timestamp of the last post, what post number does it link to? (example, this topic, it should be 15), as you can see they differ on this topic, which means there was a deleted post at a point in time (in this topics case, it was Post #2, that was deleted).

---

<div class="post-metadata">

### Author: ![CosM](https://avatars.discourse-cdn.com/v4/letter/c/a8b319/32.png) [@CosM](https://meta.discourse.org/u/CosM)
#### Post date: [February 7, 2017, 3:36pm UTC](https://meta.discourse.org/t/canonical-tag-on-topic-url/57057/16 "2017-02-07T15:36:26Z")

</div>

> [@cpradio](#):
>
> As to how to tell if a topic has deleted posts, open the topic, navigate to the very last post. Take note of the post number count in the timeline (example, this topic, it should be 14), click on the timestamp of the last post, what post number does it link to? (example, this topic, it should be 15), as you can see they differ on this topic, which means there was a deleted post at a point in time (in this topics case, it was Post #2, that was deleted).

No, they are exactly the same.

---

<div class="post-metadata">

### Author: ![cpradio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cpradio/32/4970_2.png) [@cpradio](https://meta.discourse.org/u/cpradio)
#### Post date: [February 7, 2017, 3:37pm UTC](https://meta.discourse.org/t/canonical-tag-on-topic-url/57057/17 "2017-02-07T15:37:24Z")

</div>

Bummer. I’m out of ideas unfortunately. I haven’t a clue why Googlebot would be looking for a page that doesn’t exist on a small subset of topics. ☹

---

<div class="post-metadata">

### Author: ![CosM](https://avatars.discourse-cdn.com/v4/letter/c/a8b319/32.png) [@CosM](https://meta.discourse.org/u/CosM)
#### Post date: [February 7, 2017, 3:51pm UTC](https://meta.discourse.org/t/canonical-tag-on-topic-url/57057/18 "2017-02-07T15:51:24Z")

</div>

@cpradio thanks anyway !

@zogstrip any more thoughts ?

Thanks,  
CosM

---

<div class="post-metadata">

### Author: ![neil](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/neil/32/102150_2.png) [@neil](https://meta.discourse.org/u/neil)
#### Post date: [February 7, 2017, 4:16pm UTC](https://meta.discourse.org/t/canonical-tag-on-topic-url/57057/19 "2017-02-07T16:16:41Z")

</div>

I looked up [Google’s guidelines about paginated content](https://support.google.com/webmasters/answer/1663744?hl=en), and I think we’re not following it well enough…

- We’re using `<a rel="next">` and `<a rel="prev">` in the **body** , but the guidelines say to use `<link rel="next">` and `<link rel="prev">` in the **head**.

If we get it wrong (which we are), they say:

> If Google finds mistakes in your implementation…, we’ll continue to index the page(s), and rely on our own heuristics to understand your content.

So I think @cpradio is right that Googlebot is trying to guess the url for the next page. It’s getting a 404 page, which it shouldn’t be indexing… but if we put `link` elements in the `head` then Googlebot might not need to guess anymore.

---

<div class="post-metadata">

### Author: ![CosM](https://avatars.discourse-cdn.com/v4/letter/c/a8b319/32.png) [@CosM](https://meta.discourse.org/u/CosM)
#### Post date: [February 7, 2017, 4:31pm UTC](https://meta.discourse.org/t/canonical-tag-on-topic-url/57057/20 "2017-02-07T16:31:58Z")

</div>

Thanks @neil !

Is this a fix that you will consider for a future release ?  
If yes it would be great if you could provide a link so that I can track its progress.

Thanks,  
CosM

---

<div class="post-metadata">

### Author: ![neil](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/neil/32/102150_2.png) [@neil](https://meta.discourse.org/u/neil)
#### Post date: [February 7, 2017, 4:44pm UTC](https://meta.discourse.org/t/canonical-tag-on-topic-url/57057/21 "2017-02-07T16:44:27Z")

</div>

Yeah it should be an easy fix. I’ll post here when it’s done.

[Next page](https://meta.discourse.org/t/canonical-tag-on-topic-url/57057.md?page=2)
