Make WordPress Core

Opened 5 years ago

Closed 5 years ago

#47025 closed defect (bug) (invalid)

Adding canonical tag feature

Reported by: haseeb007's profile haseeb007 Owned by:
Milestone: Priority: normal
Severity: normal Version: 5.2
Component: TinyMCE Keywords:
Focuses: Cc:

Description

Hello, I still use the classic editor in WordPress. While adding a hyperlink to text in post editor, the options that we get are only the link field and a check box for opening the link into a new tab. There should be one more option for adding a canonical tag. Currently, what I have to do is going to the text window and type rel=canonical manually.
Please add this feature.

Change History (2)

#1 @SergeyBiryukov
5 years ago

  • Component changed from General to TinyMCE
  • Keywords close added
  • Severity changed from major to normal

Hi @haseeb007, welcome to WordPress Trac! Thanks for the ticket.

Unless I'm missing something, <link rel="canonical"> should only be used in the <head> section, not in the content area, so an option for adding a canonical tag does not belong in the content editor.

Last edited 5 years ago by SergeyBiryukov (previous) (diff)

#2 @desrosj
5 years ago

  • Keywords close removed
  • Milestone Awaiting Review deleted
  • Resolution set to invalid
  • Status changed from new to closed

Hi @haseeb007,

I just did some research, and it appears that @SergeyBiryukov is correct.

rel="canonical" is only allowed as an attribute of the <link> tag, which is only allowed within the <head> tag (unless the type is body-ok, which canonical is not). Search engines have also been known to ignore any rel="canonical" attributes found within the <body> tag.

If this is no longer correct and you can provide some references demonstrating, this can be reopened and reevaluated!

Note: See TracTickets for help on using tickets.