Skip to content

Instantly share code, notes, and snippets.

@amboutwe
Last active October 5, 2020 08:39
Show Gist options
  • Star 11 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save amboutwe/e5b83cd990b5c1bc4015c20f5e3cd754 to your computer and use it in GitHub Desktop.
Save amboutwe/e5b83cd990b5c1bc4015c20f5e3cd754 to your computer and use it in GitHub Desktop.
Remove Date Meta Tags Output by Yoast SEO
<?php
/********* DO NOT COPY THE PARTS ABOVE THIS LINE *********/
/* Remove Date Meta Tags Output by Yoast SEO
* Credit: Yoast development team
* Last Tested: Apr 09 2019 using Yoast SEO 10.1.3 on WordPress 5.1.1
* For Yoast SEO 14.0 or newer, please see https://yoast.com/help/date-appears-search-results/#h-managing-dates
*/
add_action('wpseo_dc_'.'DC.date.issued', '__return_false'); // Premium versions 5.2 or older
add_filter( 'wpseo_og_article_published_time', '__return_false' ); // Versions 13.5 or older
add_filter( 'wpseo_og_article_modified_time', '__return_false' ); // Versions 13.5 or older
add_filter( 'wpseo_og_og_updated_time', '__return_false' ); // Versions 13.5 or older
@amplarede
Copy link

where should i put it?

@tittisan
Copy link

tittisan commented Oct 2, 2020

In functions.php of the child theme, but doesn't work at all.
Any other tips?

@amboutwe
Copy link
Author

amboutwe commented Oct 3, 2020

@tittisan Thank you for bringing this to my attention. These filters are for older versions of Yoast SEO. Please see this article for more information on Yoast and date output: https://yoast.com/help/date-appears-search-results/#h-managing-dates

@tittisan
Copy link

tittisan commented Oct 5, 2020

Found the solution here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment