Last active
June 9, 2023 12:51
-
-
Save nicomollet/1b90b5e8db8913a74974f005d7105e27 to your computer and use it in GitHub Desktop.
Yoast Schema: Remove datePublished on WebPage
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Yoast Schema: Remove datePublished on WebPage | |
* | |
* @param array $schema | |
* | |
* @return mixed | |
*/ | |
function custom_wpseo_schema_webpage( $schema ) { | |
// Unset the published date | |
if ( isset( $schema["datePublished"] ) ) { | |
unset( $schema["datePublished"] ); | |
} | |
return $schema; | |
} | |
add_filter( 'wpseo_schema_webpage', 'custom_wpseo_schema_webpage', 100, 1 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment