A
A
amagon2018-05-01 18:46:12
WordPress
amagon, 2018-05-01 18:46:12

Wordpress writes the title of the page by first letters and opens it, how to fix it?

Good afternoon. Such a situation, let's say there is a page " http://sayt.ru/sample-page/ ", and when I type " http://sayt.ru/sa" wordpress instead of returning a 404 error opens a page at " http://sayt.ru/sample-page/ ", tell me if anyone knows how to fix this?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Syomka Gavrilenko, 2018-05-02
@amagon

This is an automatic redirect in WP.
You need to add the following code to your functions.php file to disable this feature:

function remove_redirect_guess_404_permalink( $redirect_url ) {
    if ( is_404() )
        return false;
    return $redirect_url;
}

add_filter( 'redirect_canonical', 'remove_redirect_guess_404_permalink' );

You can read more about this in English Ability to disable redirect_guess_404_permalink()

A
Ainur Valiev, 2018-05-01
@vaajnur

This is browser autocomplete. delete cache, history.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question