eliminar dateModified y datePublished del snippet type “ItemPage”

#126079
  • Resolved Titín Colomer
    Rank Math free

    Buenas!
    tengo una tienda con woocommerce y no me interesa que aparezca la fecha en los resultados de búsqueda de los productos en Google, de hecho a la competencia no le aparece.

    he borrado todo resto de fechas en el theme avada pero por culpa de RankMath la fecha me sale en varios snippets.

    -he conseguido borrar el og:updated_time con este filtro:
    add_filter( "rank_math/opengraph/facebook/og_updated_time","__return_false");
    -he conseguido borrar la fecha del snippet “@type”: “product” con este otro filtro:

    add_filter( 'rank_math/snippet/rich_snippet_product_entity', function( $entity ) {
       unset( $entity['datePublished']);
       unset( $entity['dateModified']);
       unset( $entity['releaseDate']);
    
       return $entity;
    });

    pero no consigo borrar dateModified y datePublished del snippet “@type”: “ItemPage”

    es el último rastro de fecha que me queda en las páginas de productos… para que google no siga mostrándola.
    podéis ayudarme con algún filtro, Gracias!!!

Viewing 15 replies - 1 through 15 (of 15 total)
  • Hello,

    Thank you for contacting Rank Math and bringing your concern to our attention. I’m sorry for the delay and for any inconvenience this issue may have caused you.

    Google recommends these properties for your schema markup. However, if you still wish to remove these, you can use the following filter:

    /**
     * Filter to change the schema data.
     * Replace $schema_type with schema name like article, review, etc.
     * @param array $entity Snippet Data
     * @return array
     */
    add_filter( "rank_math/snippet/rich_snippet_{$schema}_entity", function( $entity ) { 
             unset( $entity['datePublished']);
             unset( $entity['dateModified']);
             return $entity;
    });

    The code is to be customized and added to your theme functions.php file.

    I hope that helps. Thank you, and looking forward to your update.

    Buenas, ese filtro ya lo he probado pero no elimina la fechas “datePublished” “dateModified” del snippet “@type”: “ItemPage”
    me sigue apareciendo:

    "@type": "ItemPage",
                "@id": "https://lachaine.es/producto/queso-feta-griego-150-g/#webpage",
                "url": "https://lachaine.es/producto/queso-feta-griego-150-g/",
                "name": "\u25b7 Comprar Queso Feta 150g De Gran Calidad D.O. » La Chaine",
                "datePublished": "2020-10-09T10:44:57+02:00",
                "dateModified": "2020-12-25T22:57:51+01:00",
                "isPartOf": {
                    "@id": "https://lachaine.es/#website"
                },

    Hello,

    I checked your page from my end and the specified entities seem to be removed, here is a screenshot: https://i.rankmath.com/fRbB3z

    Please clear your browser cache or check the page in a private/incognito window and if this persists, do share a screenshot from your end using a tool like https://imgbb.com

    Looking forward to helping you.

    Buenas, gracias por tu ayuda,
    efectivamente, ahora no sale porque he tenido que comentar (provisionalmente) unas líneas del código de vuestro plugin (en el archivo class-webpage.php que se encuentra en la carpeta includes/modules/schema/snippets/), pero sé que esto no debería haberlo hecho, por eso buscaba otra solución no tan agresiva. sobre todo pensando en futuras actualizaciones.

    he vuelto a dejar como estaba el código de vuestro plugin para que veas como vuelve a aparecer datePublished y dateModified.

    Hello,

    Thank you for the follow up.

    Since you want to unset data related to itemPage, this is the $schema_type you should use in the code and your code should therefore be as follows:

    
    /**
     * Filter to change the schema data.
     * Replace $schema_type with schema name like article, review, etc.
     * @param array $entity Snippet Data
     * @return array
     */
    add_filter( "rank_math/snippet/rich_snippet_ItemPage_entity", function( $entity ) { 
             unset( $entity['datePublished']);
             unset( $entity['dateModified']);
             return $entity;
    });
    

    If this still doesn’t help then, we might need to take a closer look at the settings. Please edit the first post on this ticket and include your WordPress & FTP logins in the designated Sensitive Data section.
    Sensitive Data Section

    It is completely secure and only our support staff has access to that section. If you want, you can use the below plugin to generate a temporary login URL to your website and share that with us instead:

    https://wordpress.org/plugins/temporary-login-without-password/

    You can use the above plugin in conjunction with the WP Security Audit Log to monitor what changes our staff might make on your website (if any):

    https://wordpress.org/plugins/wp-security-audit-log/

    We really look forward to helping you.

    Hello,

    I have updated the sensitive data as requested. Can you please check further?

    Thank you.

    Hello,

    The shared access doesn’t seem to work, please check the screenshot I have added in the sensitive section.

    Please update this and confirm it is working from your end so we can look into this further.

    Looking forward to helping you. Thank you.

    Lo siento, se habían colado algunos espacios.
    ya están las contraseñas rectificadas y probadas.
    Gracias por todo

    Hello,

    We have added this code that removes the datePublished and dateModified fields from your JSON-LD Schema:

    add_filter( 'rank_math/json_ld', function( $data, $jsonld ) {
      unset( $data["WebPage"]["datePublished"] );
      unset( $data["WebPage"]["dateModified"] );
      return $data;
    }, 99, 2);

    We can confirm that both those fields are gone from the page source.

    Please check this from your end as well and let us know if you need help with anything else.

    Muchas gracias, sois los mejores!

    pero antes de cerrar el ticket, una cosa más…
    Google es muy caprichoso y ahora está cogiendo la fecha de publicación de una opinión del producto que hizo una cliente…
    adjunto foto del resultado de búsqueda:
    https://ibb.co/Tb1BX8j
    y del del snnipet que aparece en el código de la página:
    https://ibb.co/XLy5Myr

    he comprobado que en el resto de productos pasa lo mismo…
    no sé porque la competencia no le sale la fecha en los schemas y a mi me coge ese dato hasta de las opiniones…

    he probado a poner el filtro que soléis facilitar pero no funciona:

    add_filter( "rank_math/snippet/rich_snippet_review_entity", function( $entity ) { 
       unset( $entity['datePublished']);
       unset( $entity['dateModified']);
       return $entity;
    });

    Gracias por todo nuevamente!

    Hello,

    The date shown in your page source is the date of the review added by the specified author.

    As for the date shown in your search results, this is known to be added by the theme settings, Rank math doesn’t add this. You will need to check with your theme provider to hep you remove this date feature.

    Hope this helps.

    Buenas, precisamente los schemas del tema avada los tengo desactivados porque estoy usando los schemas del plugin Rank Math…

    de hecho si desactivo los schemas de vuestro plugin aqui:
    https://ibb.co/TbgzFfj

    También desaparece ese schema de opiniones del código de producto (que es el que me afecta en los resultados de google), por lo que si que tiene que ser código de vuestro plugin.

    Gracias

    Hello,

    You can try the following to remove this and see if it makes any difference:

    
    add_filter( 'rank_math/json_ld', function( $data, $jsonld ) {
      unset( $data["review"]["datePublished"] );
      return $data;
    }, 99, 2);
    

    Hope this helps

    Buenas de nuevo, he añadido el filtro pero no parece funcionar… sigue apareciendo las fechas de publicación en los schemas de opiniones de vuestro plugin

    Hello,

    We are afraid that code is not coming from Rank Math.

    As you can see in the below screencast, it appears even when Rank Math is disabled.
    https://i.rankmath.com/QwzeDd

    So, you will need to check where it is coming from and remove it from the source.

    Hope that helps.

    Hello,

    Since we did not hear back from you for 15 days, we are assuming that you found the solution. We are closing this support ticket.

    If you still need assistance or any other help, please feel free to open a new support ticket, and we will be more than happy to assist.

    Thank you.

Viewing 15 replies - 1 through 15 (of 15 total)

The ticket ‘eliminar dateModified y datePublished del snippet type “ItemPage”’ is closed to new replies.