WordPress.org

Make WordPress Core

Opened 4 years ago

Last modified 11 months ago

#22879 new defect (bug)

Canonical Link Missing on Front Page

Reported by: miqrogroove Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 3.4.2
Component: Canonical Keywords: needs-patch
Focuses: Cc:

Description

Canonical links are provided for posts, so if someone links to /2012/12/my-post/?whatever then Google will know it is a duplicate of /2012/12/my-post/

But if someone links to /?whatever there is no canonical address.

Attachments (1)

22879.diff (1.2 KB) - added by iworks 11 months ago.

Download all attachments as: .zip

Change History (8)

#1 follow-up: @miqrogroove
4 years ago

This is also a problem with the default search path, /?s= where WordPress uses the wrong template and displays the front page instead of the search results page.

Last edited 4 years ago by miqrogroove (previous) (diff)

#2 in reply to: ↑ 1 @ocean90
4 years ago

Replying to miqrogroove:

This is also a problem with the default search path, /?s= where WordPress uses the wrong template and displays the front page instead of the search results page.

#11330

#3 @onetarek
4 years ago

Related to Ticket #23060

#4 @chriscct7
13 months ago

  • Keywords needs-patch added

#5 follow-up: @NickDuncan
12 months ago

I have tested this on 4.4-alpha-33636-src with post name permalinks and even if you use
/post-1/?variable=anything
the canonical link still points to the parent URL of
/post-1/

#6 in reply to: ↑ 5 @SergeyBiryukov
12 months ago

@NickDuncan: Thanks for testing, but it looks like the ticket is about missing canonical link on front page, not on a post.

On the other hand, the current implementation was specifically introduced for singular pages, see [11777].

#7 @iworks
11 months ago

Patch contains:

  • canonical for home/front_page
  • canonical for search result

I'm not sure we should add canonical url for taxonomies. If yes, give me a sing and I add this.

@iworks
11 months ago

Note: See TracTickets for help on using tickets.