[Support request] Fecha en resultados de Google

Home Forums Support [Support request] Fecha en resultados de Google

Home Forums Support Fecha en resultados de Google

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #2245834
    jmpefe78gmail-com

    Hola quiero que Google no muestre la fecha en sus resultados de artículos publicados con más de 180 días

    Para ello quiero meter este código <?php

    $change_date = strtotime(‘-45 days’);

    $post_date = strtotime(get_the_date(‘m/d/Y’));

    if($post_date > $change_date) { ?>

    VA EL CÓDIGO QUE TIENE GENERATEPRESS PARA MOSTRAR LA FECHA

    <?php } ?>

    No encuentro en que archivo está el código en Generate press par añadir esas líneas.

    En cualquier caso si hay otro código si me lo dáis y me decis donde incluirlo os lo agradezco

    Un saludo

    #2245870
    jmpefe78gmail-com

    Lo que tampoco entiendo es porqué se muestra en Google algunos artículos publicados en 2017 cuando se han actualizado al 2021 por ejemplo. Dejo información privada con la imagen y la urls

    #2245873
    David
    Staff
    Customer Support

    Hi there,

    see my reply here that provides the code you need:

    https://generatepress.com/forums/topic/only-show-published-and-updated-dates-if-the-post-is-6-months-old-or-younger/#post-1995891

    Please note: This will remove the Dates that GeneratePress adds. It will not remove any dates that may be added by an SEO or Schema plugin. Also removing a date from the Theme doesn’t mean that Google will respect that change.

    #2245885
    jmpefe78gmail-com

    Ok, perfecto, ¿dónde meto este código?, ¿en el funtions.php? Puedo usar un hook, es ese caso como lo hago?

    #2245914
    David
    Staff
    Customer Support

    This doc explains how to add the PHP:

    https://docs.generatepress.com/article/adding-php/

    TLDR: Are you using a Child Theme?
    If Yes – it goes in the Child Theme > functions.php
    If No – use the Code Snippets plugin

    #2245924
    jmpefe78gmail-com

    Ok, gracias, a ver si se arregla

    #2245933
    David
    Staff
    Customer Support

    You’re welcome

Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.