[wp-trac] [WordPress Trac] #16557: Ability to disable redirect_guess_404_permalink()
WordPress Trac
noreply at wordpress.org
Sun Sep 2 14:29:16 UTC 2018
#16557: Ability to disable redirect_guess_404_permalink()
------------------------------------+-----------------------------
Reporter: msafi | Owner: (none)
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 DrLightman):
Could you please, after 8 years, fullfill this request? Guessing to save a
404 by providing another resource is not right, as others have stated.
Also it adds up a database overload by full scanning of the wp_posts table
thanks to the `post_name LIKE %s` query that may fail 90% of the times.
Even a bool filter before like this would do:
{{{#!php
$do_the_guess = apply_filters('do_redirect_guess_404_permalink', true);
if ( ! $redirect_url && $do_the_guess ) {
if ( $redirect_url = redirect_guess_404_permalink() ) {
...
}}}
Thank you
--
Ticket URL: <https://core.trac.wordpress.org/ticket/16557#comment:32>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list