[wp-trac] [WordPress Trac] #16557: Ability to disable redirect_guess_404_permalink()

WordPress Trac noreply at wordpress.org
Sun Feb 11 22:25:59 UTC 2018


#16557: Ability to disable redirect_guess_404_permalink()
------------------------------------+-----------------------------
 Reporter:  msafi                   |       Owner:
     Type:  enhancement             |      Status:  new
 Priority:  normal                  |   Milestone:  Future Release
Component:  Canonical               |     Version:  3.1
 Severity:  minor                   |  Resolution:
 Keywords:  has-patch dev-feedback  |     Focuses:
------------------------------------+-----------------------------

Comment (by martychc23):

 Replying to [comment:28 esemlabel]:
 > The if statement should contain exclusion of $_GET 'p' parametr for link
 rel='shortlink' to work properly.
 >
 > {{{
 > function remove_redirect_guess_404_permalink( $redirect_url ) {
 >       if ( is_404() && !isset($_GET['p']) )
 >               return false;
 >       return $redirect_url;
 > }
 > add_filter( 'redirect_canonical', 'remove_redirect_guess_404_permalink'
 );
 > }}}

 Could you provide the corrected code?

 I agree with the others, this auto complete url needs to be sorted out.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/16557#comment:31>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list