How can I disable URL autocomplete (URL guessing) in WordPress? The answers that I found either don’t work or I don’t understand!

[ad_1]

When you enter an invalid URL in WordPress, it tries to guess which URL you meant.

For example, if I accidentally enter [https://example.com/a](https://example.com/a), WordPress guesses that I meant [https://example.com/about/](https://example.com/about/). While that might seem reasonable, other guesses return completely the wrong page (e.g. a thank-you page totally out of context), and in some cases pages that aren’t even supposed to be shown. WordPress seems to use wild guesses, with no way to control them.

For my website, it’s a feature that I need to turn off (I realise that it might be a great feature for other websites, but for me, it’s no good).

I’ve been searching at length for a solution to this. I found [a plugin](https://en-gb.wordpress.org/plugins/disable-url-autocorrect-guessing/) to do this, but it hasn’t been updated since version 5.5 four years ago, so it’s probably a bad idea to use this.

[A bug report](https://core.trac.wordpress.org/ticket/16557) for this has been marked as closed and fixed, but unless I’m missing something, it seems as though it hasn’t actually been fixed.

I found suggestions to change the functions file ([this one](https://wordpress.stackexchange.com/q/144937/172018) explains exactly what I’m after; here’s [another](https://wpsurfer.com/stop-wordpress-from-guessing-urls/) and yet [another](https://stackoverflow.com/a/72421511/2678429) solution). Unfortunately, I’m not a professional website developer, just working on my own website, and so I don’t know what functions file they mean. I also understand that if I do this, I have to create a child theme, something that I’ve never done and don’t know how to go about doing; it feels like an unnecessary complication.

I found some other solution that mentioned adding something to the `wp-config.php` file (I forget what), but that didn’t work; it actually broke the website until I removed it again.

Can you help me to remove this guessing feature, please?

[ad_2]
1 Comment

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer