How to avoid bypass of search bar rules?

You want to use the pre_get_posts action to modify the search query on the server side. The pre_get_posts Codex have some examples to get you started.

To target the main search query, try this:

function my_search_filter( $query ) {
    if ( ! is_admin() && $query->is_main_query() ) {
        if ( $query->is_search ) {
            // Use $query->set(); to do stuff here.
        }
    }
}
add_action( 'pre_get_posts', 'my_search_filter' );