[wp-trac] [WordPress Trac] #48216: Option to disable/bypass/shortcircuit redirect_guess_404_permalink

WordPress Trac noreply at wordpress.org
Fri Oct 4 23:19:02 UTC 2019


#48216: Option to disable/bypass/shortcircuit redirect_guess_404_permalink
-------------------------+-----------------------------
 Reporter:  apedog       |      Owner:  (none)
     Type:  enhancement  |     Status:  new
 Priority:  normal       |  Milestone:  Awaiting Review
Component:  Canonical    |    Version:
 Severity:  normal       |   Keywords:
  Focuses:               |
-------------------------+-----------------------------
 The {{{redirect_canonical}}} filter is useful for most cases. But its
 implementation is quirky and can lead to some unexpected results. One of
 its most annoying quirks is the {{{redirect_guess_404_permalink}}}
 implementation.

 For example, when a cpt and attachment have the same (or similar) slug.
 {{{mysite.com/a_slug}}} will redirect to {{{mysite.com/a_post/a_slug-2}}}
 (attachment page) instead of {{{mysite.com/cpt/a_slug}}} when both exist.

 Could WordPress add an option to diable/filter/short-circuit only the
 auto-guess while still leaving all the ?p=123 => pretty permalink
 redirects in place.

 Ideally it would be nice to have a settings page to fiddle with the
 redirect canonical options. ie. never redirect to an attachment page,
 ''or'' a more robust auto-guess function that prefers the actual slug over
 similar slugs ''or'' have the auto-guess prefer posts over attachments,
 etc. But a simple disable of the auto-guess seems like it can be
 implemented quite easily.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/48216>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list