/****************************************************** * MASTER INDEXING FIX – SEOPRESS + WORDPRESS * Forces index/follow, fixes canonical issues, * removes noindex tags, fixes headers, sitemap, * soft 404, crawl budget, redirect URLs, etc. ******************************************************/ /* 1. Force global index/follow for SEOPress */ add_filter('seopress_robots_value', function($robots) { return 'index,follow,max-snippet:-1,max-image-preview:large,max-video-preview:-1'; }); /* 2. Remove all meta robots noindex tags from HTML output */ add_action('wp_head', function() { ob_start(function($output){ return preg_replace('/]+name=["\']robots["\'][^>]+noindex[^>]*>/i', '', $output); }); }, 0); /* 3. Remove X-Robots-Tag noindex headers & force index,follow */ add_action('send_headers', function() { header_remove('X-Robots-Tag'); header('X-Robots-Tag: index, follow'); }); /* 4. Force canonical to the real URL (fixes duplicate & wrong canonical) */ add_filter('seopress_canonical_url', function($canonical) { return get_permalink(); }); /* 5. Remove redirected URLs from XML sitemaps */ add_filter('wp_sitemaps_posts_entry', function($entry, $post) { // If permalink resolves differently → remove from sitemap if ( wp_redirect_admin_locations(get_permalink($post)) ) { return []; } return $entry; }, 10, 2); /* 6. Force fresh lastmod values to trigger faster recrawling */ add_filter('wp_sitemaps_posts_entry', function($entry, $post) { $entry['lastmod'] = gmdate('Y-m-d\TH:i:s\Z'); return $entry; }, 20, 2); /* 7. Strong crawl priority signals (Googlebot & general robots) */ add_action('wp_head', function() { echo ''; echo ''; }); /* 8. Prevent soft 404 by enforcing 200 status for valid posts/pages */ add_action('template_redirect', function() { if (is_singular() && !is_404()) { status_header(200); } }); /* 9. Disable sitemap caching → forces fresh discovery */ add_filter('wp_sitemaps_cache_duration', function() { return 0; }); Royal Rumble as Oyo kingmakers reject Governor's directive, insist Gbadegesin is Alaafin-elect - iDeemlawful