Welcome to the staging ground for new communities! Each proposal has a description in the "Descriptions" category and a body of questions and answers in "Incubator Q&A". You can ask questions (and get answers, we hope!) right away, and start new proposals.
Are you here to participate in a specific proposal? Click on the proposal tag (with the dark outline) to see only posts about that proposal and not all of the others that are in progress. Tags are at the bottom of each post.
How should canonical URLs be used with comments? Question
Canonical URLS are highly recommended for SEO and to prevent competition between duplicate pages. I've been trying to implement this, but I'm unsure how to implement this for pages which repeat but emphasize or expand portions.
Specifically, I'm trying to implement them for comment permalinks. The page still displays all of the main content, but one specific comment they're under is boosted to the top and its children replies are shown. Does that mean the comment should have its own canonical URL or should I redirect everything to the overall page since it's mostly the same?
1 answer
A canonical URL should be the primary URL to represent ALL the content on the page. The URL that highlights a particular comment creates a variation of that page. The comment URL should never be the canonical URL, rather it should refer to the main URL for the page as the canonical URL.
For example, if your page is https://example.com/my-page
, it could have a self-referencing canonical URL <link rel=canonical href=https://example.com/my-page>
.
Then you might choose a URL for a particular comment from among several possibilities:
https://example.com/my-page#comment3
https://example.com/my-page-comment-3
https://example.com/comment-3
Regardless of which URL you choose to show a specific comment, the canonical URL should point back to the main URL for the page which includes the comment without highlighting it: <link rel=canonical href=https://example.com/my-page>
This is a case in which canonical links are needed rather than redirects. Redirects change the URL for users which wouldn't be desirable. You want to let users see the highlighted comment front and center. However search engines need to be told that the content on the page is duplicate and you would prefer that they index another variant.
If you don't use canonical URLs in this situation, search engines will detect the duplicate content and choose one one URL to index. They may or not make the correct choice to index the main URL for the page.
0 comment threads