WordPress.org

Make WordPress Core

Opened 3 years ago

Closed 2 years ago

#18508 closed defect (bug) (worksforme)

infinite Loop between canonical and 301 redirection

Reported by: notraf Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.2.1
Component: Canonical Keywords: reporter-feedback
Focuses: Cc:

Description

When I redirect (301) a page A to another not canonical B, the B page is showed but with canonical pointing to A in the code.

This is a loop for search engines and bad for SEO.

I suggest the automatic change of canonical URL to the 301 redirected whit redirection plugin or .htaccess , or at least the option of disable canonical at all, or page to page, or the change of canonical page to page.

Change History (3)

comment:1 duck_3 years ago

I'm afraid I couldn't really follow what you were describing.

However, it is possible to disable canonical if you would like to do so. Remove redirect_canonical from the template_redirect hook. Like this:

remove_action('template_redirect', 'redirect_canonical');

comment:2 SergeyBiryukov3 years ago

I guess the ticket is about rel='canonical'.

It can be disabled too:

remove_action( 'wp_head', 'rel_canonical' );
Last edited 3 years ago by SergeyBiryukov (previous) (diff)

comment:3 nacin2 years ago

  • Keywords reporter-feedback added
  • Milestone Awaiting Review deleted
  • Resolution set to worksforme
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.