add_rewrite_rule – how to match exact whole word only?
Here’s the updated code with the explanation and last two lines added: Updated Code with Last Two Lines add_action(‘query_vars’, ‘add_query_vars’); function add_query_vars($vars) { $vars[] = ‘verify’; // Add ‘verify’ as a query variable return $vars; } add_action(‘init’, ‘verify_add_rewrite_rule’); function verify_add_rewrite_rule() { // Use ^verify/?$ to strictly match “verify” and ensure it ends there add_rewrite_rule(‘^verify/?$’, ‘index.php?verify=1&post_type=page’, … Read more