/**
 * GUARD 1: ?_paged=N fuera de rango -> 404
 * Si paged > max_num_pages respondemos 404 en vez de 200 vacio.
 */
add_action('template_redirect', 'ph_guard_out_of_range_paged', 5);
function ph_guard_out_of_range_paged() {
    if (is_admin() || (defined('DOING_AJAX') && DOING_AJAX)) return;
    if (!isset($_GET['_paged']) || !is_numeric($_GET['_paged'])) return;
    $paged = (int) $_GET['_paged'];
    if ($paged <= 1) return;
    global $wp_query;
    $max = (int) ($wp_query->max_num_pages ?? 0);
    if ($max === 0 || $paged > $max) {
        $wp_query->set_404();
        status_header(404);
        nocache_headers();
        add_filter('wpseo_canonical',             '__return_false', 999);
        add_filter('rank_math/frontend/canonical', '__return_false', 999);
    }
}

/**
 * GUARD 2: /page/N/ nativo -> redirigir a ?_paged=N o 404
 * Las URLs /page/N/ no deberian ser accesibles (el frontend usa ?_paged=).
 * Si N esta en rango: 301 a baseURL?_paged=N
 * Si N esta fuera de rango: 404
 */
add_action('template_redirect', 'ph_redirect_native_page_to_custom_paged', 6);
function ph_redirect_native_page_to_custom_paged() {
    if (is_admin() || (defined('DOING_AJAX') && DOING_AJAX)) return;
    if (!is_paged()) return;
    $paged = (int) get_query_var('paged');
    if ($paged <= 1) return;
    global $wp_query;
    $max = (int) ($wp_query->max_num_pages ?? 0);
    if ($max > 0 && $paged > $max) {
        $wp_query->set_404();
        status_header(404);
        nocache_headers();
        return;
    }
    $base_url = '';
    if (is_category() || is_tag() || is_tax()) {
        $obj = get_queried_object();
        if ($obj) {
            $url = get_term_link($obj);
            if ($url && !is_wp_error($url)) $base_url = $url;
        }
    } elseif (is_post_type_archive()) {
        $post_type = get_query_var('post_type');
        if (is_array($post_type)) $post_type = reset($post_type);
        $url = get_post_type_archive_link($post_type);
        if ($url && !is_wp_error($url)) $base_url = $url;
    }
    if (empty($base_url)) return;
    $redirect = add_query_arg('_paged', $paged, user_trailingslashit($base_url));
    wp_redirect($redirect, 301);
    exit;
}
{"id":14799,"date":"2024-06-06T16:43:59","date_gmt":"2024-06-06T16:43:59","guid":{"rendered":"https:\/\/pala-hack.com\/palas-padel\/drop-shot-renegade-control-2024\/"},"modified":"2026-02-09T20:08:31","modified_gmt":"2026-02-09T20:08:31","slug":"drop-shot-renegade-control-2024","status":"publish","type":"pala","link":"https:\/\/pala-hack.com\/sv\/padel-racketar\/drop-shot\/drop-shot-renegade-control-2024\/","title":{"rendered":"Drop Shot Renegade Control 2024"},"content":{"rendered":"","protected":false},"excerpt":{"rendered":"<p>Pala<\/p>\n","protected":false},"author":1,"featured_media":15136,"menu_order":0,"comment_status":"open","ping_status":"closed","template":"","meta":{"_acf_changed":false,"footnotes":""},"marca_pala":[563],"tipo_jugador":[671],"forma_pala":[713],"nivel_jugador":[720,734],"balance_pala":[748],"tacto_pala":[776,762],"superficie_pala":[790],"tipo_juego":[797],"pros_pala":[],"contras_pala":[],"class_list":["post-14799","pala","type-pala","status-publish","has-post-thumbnail","hentry","marca_pala-drop-shot","tipo_jugador-man","forma_pala-rund","nivel_jugador-avancerad","nivel_jugador-medel","balance_pala-lag","tacto_pala-medium","tacto_pala-mjuk","superficie_pala-skrovlig","tipo_juego-kontroll"],"acf":{"nucleo":"Eva Soft","cara":"Carbon 3K + 3D","marco":"Carbon Twin Tubular System","acabado":"Relieve 3D","temporada":2024,"potencia":7,"punto_dulce":7,"salida_bola":7.25,"control":8,"manejabilidad":7.5,"puntuacion_total":7.35,"analisis":"","pvpr":190,"mejor_precio_url":"https:\/\/www.amazon.es\/Pala-Drop-Shot-Renegade-Control\/dp\/B0CQRH3SR1?&tag=tennis-hack-21","mejor_precio":153.9,"disponibilidad":1,"porcentaje_descuento":19,"scrape_tradeinn":"https:\/\/www.tradeinn.com\/smashinn\/es\/drop-shot-pala-de-padel-renegade-control\/140758747\/p","url_tradeinn":"https:\/\/tnkdbf.tradeinn.com\/ts\/i5034676\/tsc?amc=con.blbn.503976.515016.14119793&rmd=3&trg=https:\/\/www.tradeinn.com\/smashinn\/es\/drop-shot-pala-de-padel-renegade-control\/140758747\/p","precio_tradeinn":190,"scrape_amazon":"https:\/\/www.amazon.es\/Pala-Drop-Shot-Renegade-Control\/dp\/B0CQRH3SR1","url_amazon":"https:\/\/www.amazon.es\/Pala-Drop-Shot-Renegade-Control\/dp\/B0CQRH3SR1?&tag=tennis-hack-21","precio_amazon":153.9,"scrape_decathlon":"","url_decathlon":"https:\/\/afiliacion.decathlon.es\/tracking\/clk?act=11229&gel=0&pub=31646&org=2615&url=null","precio_decathlon":0,"scrape_elcorteingles":"","url_elcorteingles":"https:\/\/www.awin1.com\/cread.php?awinmid=13075&awinaffid=1038971&ued=null","precio_elcorteingles":0,"scrape_tennispoint":"","url_tennispoint":"https:\/\/www.awin1.com\/cread.php?awinmid=13033&awinaffid=1038971&ued=null","precio_tennispoint":0,"scrape_miravia":"https:\/\/www.miravia.es\/p\/i1359425621832859.html?spm=euspain.store_keyword.ditem_0.1.10983a2fB0LcGU&clickTrace=rn:3965803c3bc26e59e9cbd3153de254d8;pos:0;page:1&esr-custom=https%3A%2F%2Fimg.mrvcdn.com%2Fg%2Ffb%2Fkf%2FE0f65844a08734e73b929ae229ff7d80f2.jpg_720x720q75.jpg_.webp","url_miravia":"https:\/\/www.awin1.com\/cread.php?awinmid=37168&awinaffid=1622959&ued=https:\/\/www.miravia.es\/p\/i1359425621832859.html?spm=euspain.store_keyword.ditem_0.1.10983a2fB0LcGU&clickTrace=rn:3965803c3bc26e59e9cbd3153de254d8;pos:0;page:1&esr-custom=https%3A%2F%2Fimg.mrvcdn.com%2Fg%2Ffb%2Fkf%2FE0f65844a08734e73b929ae229ff7d80f2.jpg_720x720q75.jpg_.webp","precio_miravia":190,"scrape_padelmarket":"","url_padelmarket":"https:\/\/www.awin1.com\/cread.php?awinmid=24562&awinaffid=1038971&ued=null","precio_padelmarket":0,"scrape_padelproshop":"https:\/\/padelproshop.com\/en\/products\/drop-shot-renegade-control-2024","url_padelproshop":"https:\/\/pin.padelproshop.com\/t\/t?a=1883995083&as=1904223805&t=2&tk=1&url=https:\/\/padelproshop.com\/en\/products\/drop-shot-renegade-control-2024","precio_padelproshop":190,"scrape_padelnuestro":"","url_padelnuestro":"","precio_padelnuestro":"","scrape_virtualpadel":"","url_virtualpadel":"","precio_virtualpadel":"","scrape_todopadel":"","url_todopadel":"","precio_todopadel":"","scrape_streetpadel":"","url_streetpadel":"","precio_streetpadel":"","scrape_m1padel":"","url_m1padel":"","precio_m1padel":"","scrape_padeliberico":"","url_padeliberico":"","precio_padeliberico":"","scrape_padelreference":"","url_padelreference":"","precio_padelreference":"","scrape_tennispro":"","url_tennispro":"","precio_tennispro":"","scrape_forumsport":"","url_forumsport":"","precio_forumsport":"","scrape_aliexpress":"","url_aliexpress":"","precio_aliexpress":"","scrape_padelmania":"","url_padelmania":"","precio_padelmania":"","scrape_worten":"","url_worten":"","precio_worten":"","scrape_alvarez":"","url_alvarez":"","precio_alvarez":"","scrape_tiendapadelpoint":"","url_tiendapadelpoint":"","precio_tiendapadelpoint":"","scrape_padelstyle":"","url_padelstyle":"","precio_padelstyle":"","scrape_atmosferasport":"","url_atmosferasport":"","precio_atmosferasport":"","scrape_zonapadel":"","url_zonapadel":"","precio_zonapadel":"","scrape_padeltienda":"","url_padeltienda":"","precio_padeltienda":"","scrape_padelpoint":"","url_padelpoint":"","precio_padelpoint":"","scrape_sprinter":"","url_sprinter":"","precio_sprinter":"","scrape_carrefour":"","url_carrefour":"","precio_carrefour":"","scrape_stockpadel":"","url_stockpadel":"","precio_stockpadel":"","scrape_ofertasdepadel":"","url_ofertasdepadel":"","precio_ofertasdepadel":"","scrape_padelspain":"","url_padelspain":"","precio_padelspain":"","scrape_padel5":"","url_padel5":"","precio_padel5":"","scrape_tenisworldpadel":"","url_tenisworldpadel":"","precio_tenisworldpadel":"","scrape_megadeportes":"","url_megadeportes":"","precio_megadeportes":"","scrape_paleteros":"","url_paleteros":"","precio_paleteros":"","scrape_sportit":"","url_sportit":"","precio_sportit":"","scrape_privatesportshop":"","url_privatesportshop":"","precio_privatesportshop":"","scrape_jrpadel":"","url_jrpadel":"","precio_jrpadel":"","scrape_padelever":"","url_padelever":"","precio_padelever":"","scrape_topgame":"","url_topgame":"","precio_topgame":"","scrape_coronado":"","url_coronado":"","precio_coronado":"","scrape_adubasport":"","url_adubasport":"","precio_adubasport":"","scrape_originalpadel":"","url_originalpadel":"","precio_originalpadel":"","scrape_racketstore":"","url_racketstore":"","precio_racketstore":"","scrape_matchballshop":"","url_matchballshop":"","precio_matchballshop":"","scrape_wilson":"","url_wilson":"","precio_wilson":"","scrape_pelotapadel":"","url_pelotapadel":"","precio_pelotapadel":"","scrape_palapadelpro":"","url_palapadelpro":"","precio_palapadelpro":"","scrape_viladomat":"","url_viladomat":"","precio_viladomat":""},"Campo_personalizado":null,"custom_uri":"padel-racketar\/drop-shot\/drop-shot-renegade-control-2024","_links":{"self":[{"href":"https:\/\/pala-hack.com\/sv\/wp-json\/wp\/v2\/pala\/14799","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pala-hack.com\/sv\/wp-json\/wp\/v2\/pala"}],"about":[{"href":"https:\/\/pala-hack.com\/sv\/wp-json\/wp\/v2\/types\/pala"}],"author":[{"embeddable":true,"href":"https:\/\/pala-hack.com\/sv\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/pala-hack.com\/sv\/wp-json\/wp\/v2\/comments?post=14799"}],"version-history":[{"count":1,"href":"https:\/\/pala-hack.com\/sv\/wp-json\/wp\/v2\/pala\/14799\/revisions"}],"predecessor-version":[{"id":88429,"href":"https:\/\/pala-hack.com\/sv\/wp-json\/wp\/v2\/pala\/14799\/revisions\/88429"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/pala-hack.com\/sv\/wp-json\/wp\/v2\/media\/15136"}],"wp:attachment":[{"href":"https:\/\/pala-hack.com\/sv\/wp-json\/wp\/v2\/media?parent=14799"}],"wp:term":[{"taxonomy":"marca_pala","embeddable":true,"href":"https:\/\/pala-hack.com\/sv\/wp-json\/wp\/v2\/marca_pala?post=14799"},{"taxonomy":"tipo_jugador","embeddable":true,"href":"https:\/\/pala-hack.com\/sv\/wp-json\/wp\/v2\/tipo_jugador?post=14799"},{"taxonomy":"forma_pala","embeddable":true,"href":"https:\/\/pala-hack.com\/sv\/wp-json\/wp\/v2\/forma_pala?post=14799"},{"taxonomy":"nivel_jugador","embeddable":true,"href":"https:\/\/pala-hack.com\/sv\/wp-json\/wp\/v2\/nivel_jugador?post=14799"},{"taxonomy":"balance_pala","embeddable":true,"href":"https:\/\/pala-hack.com\/sv\/wp-json\/wp\/v2\/balance_pala?post=14799"},{"taxonomy":"tacto_pala","embeddable":true,"href":"https:\/\/pala-hack.com\/sv\/wp-json\/wp\/v2\/tacto_pala?post=14799"},{"taxonomy":"superficie_pala","embeddable":true,"href":"https:\/\/pala-hack.com\/sv\/wp-json\/wp\/v2\/superficie_pala?post=14799"},{"taxonomy":"tipo_juego","embeddable":true,"href":"https:\/\/pala-hack.com\/sv\/wp-json\/wp\/v2\/tipo_juego?post=14799"},{"taxonomy":"pros_pala","embeddable":true,"href":"https:\/\/pala-hack.com\/sv\/wp-json\/wp\/v2\/pros_pala?post=14799"},{"taxonomy":"contras_pala","embeddable":true,"href":"https:\/\/pala-hack.com\/sv\/wp-json\/wp\/v2\/contras_pala?post=14799"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}