add_action('init', function() { $req = $_SERVER['REQUEST_URI'] ?? ''; if ((isset($_GET['sitemap']) && $_GET['sitemap'] === 'author') || stripos($req, 'author-sitemap.xml') !== false) { wp_redirect(home_url('/sitemap_index.xml'), 301); exit; } }, -9999);