// SEO: Disable user sitemap (exposes editor usernames to scrapers)
add_filter('wp_sitemaps_add_provider', function($provider, $name) {
if ($name === 'users') return false;
return $provider;
}, 10, 2);
// SEO: Remove post_tag archives from XML sitemap (thin/low-value pages)
add_filter('wp_sitemaps_taxonomies', function($taxonomies) {
unset($taxonomies['post_tag']);
return $taxonomies;
});
// SEO: Auto-generate SEO title on publish via Gemini API (2026-03-25)
add_action('transition_post_status', 'hannity_auto_seo_title', 10, 3);
function hannity_auto_seo_title($new_status, $old_status, $post) {
// Only fire when transitioning TO publish for the first time
if ($new_status !== 'publish' || $post->post_type !== 'post') return;
if ($old_status === 'publish') return; // skip re-saves of already-published posts
// Skip if seo_title already set
if (get_post_meta($post->ID, 'seo_title', true)) return;
$title = $post->post_title;
if (empty($title)) return;
$prompt = 'Convert this news headline to a clean SEO title tag (50-65 chars max). '
. 'Remove ALL CAPS prefixes like BREAKING: BUSTED: WATCH: BOMBSHELL: etc. '
. 'Remove [WATCH] [VIDEO] suffixes. Factual, keyword-rich, no spin. '
. 'Return ONLY the SEO title as a plain string, no quotes, no explanation.'
. "\n\nHeadline: " . $title;
$api_key = 'AIzaSyB-D7nxEi4UzLdoKIZBAY_ydYS5JT8EBCU';
$url = 'https://generativelanguage.googleapis.com/v1beta/models/gemini-2.0-flash:generateContent?key=' . $api_key;
$response = wp_remote_post($url, array(
'headers' => array('Content-Type' => 'application/json'),
'body' => json_encode(array(
'contents' => array(array('parts' => array(array('text' => $prompt)))),
'generationConfig' => array('temperature' => 0.2, 'maxOutputTokens' => 100),
)),
'timeout' => 10,
));
if (is_wp_error($response)) return;
$data = json_decode(wp_remote_retrieve_body($response), true);
$seo_title = trim($data['candidates'][0]['content']['parts'][0]['text'] ?? '');
if (empty($seo_title)) return;
$seo_title = trim($seo_title, '"\''); // strip any surrounding quotes Gemini adds
update_post_meta($post->ID, 'seo_title', $seo_title);
update_post_meta($post->ID, '_seo_title', 'field_56425125fb2ed'); // ACF field key ref
}
President Donald Trump
WATCH NOW: President Trump Signs Executive Orders From Mar-a-Lago
posted by Hannity Staff - 2.18.25
President Donald Trump will sign new executive orders today from his Mar-a-Lago residence in Florida. The White House has not disclosed specific details, but the orders may involve increasing access to IVF and other campaign promises.
This story is developing…
Watch the signings above.