<?php
defined('ABSPATH') || exit;

/**
 * REEID Page SEO — Plugin Neutralizer (NON-WOO ONLY)
 *
 * Enabled ONLY when REEID page SEO is active.
 * WooCommerce is HARD excluded.
 */

add_action('wp', function () {
    if (is_admin()) {
        return;
    }

    // Canonical / hreflang override must be explicitly enabled
if ( ! (bool) get_option('reeid_seo_override_hreflang', false) ) {
    return;
}


    // HARD GUARD: never touch Woo
    if (function_exists('is_woocommerce') && is_woocommerce()) {
        return;
    }

   

    // Yoast
    remove_action('wpseo_head', 'wpseo_head', 1);

    // AIOSEO
    remove_all_actions('aioseo_head');

    // SureRank
    remove_all_actions('surerank_print_meta');

    // Rank Math canonical (FILTER-BASED)
    add_filter('rank_math/frontend/canonical', '__return_false', 99);
}, 0);

add_action('wp_head', function () {
    if ( function_exists('is_product') && is_product() ) {
        return; // never touch Woo
    }
   
}, 0);
