Point 404 pages to homepage

EDIT 2: You could also make a function to load your front-page.php template for 404 pages. See below: add_filter(‘template_include’, function($template) { if ( is_404() ) { return locate_template([‘front-page.php’]); } return $template; }); EDIT: I read over the fact that you want to keep the URL as is. Why is that if I may ask? You … Read more

How to change search page url so that it still returns a page when there’s no search query specified?

Isn’t that just because you’ve put ! empty( $_GET[‘s’] ) in your IF statement? Is your search page accessible when you remove that part? EDIT: Or maybe change your function to something like this (untested): function wpb_change_search_url() { if ( is_search() ) { if ( isset( $_GET[‘s’] ) ) { wp_redirect( home_url( “/search/” ) . … Read more