If you don’t know what 404 error is, It is an error displayed on when a user requests a web page that couldn’t be found on their server (i.e. the requested webpage is not available). In this case, If you are redirecting (302 redirects) to home page then it is confusing for end user. Definitely, you should avoid 302 redirecting for non-existent URL. Probably you don’t want to send a low quality signal to Google and other engines if they are testing how 404’s are being handled by requesting a noexist page. The best solution is to create custom 404 page having search box saying “Did you mean …?”
In this post, we will see how to prevent 404 Redirect to Homepage in WordPress.