-
As recommended following code is added, to remove showing datePublished or dateModified in search engine results.
add_filter( “rank_math/snippet/rich_snippet_{$schema}_entity”, function( $entity ) {
unset( $entity[‘datePublished’]);
unset( $entity[‘dateModified’]);
return $entity;
});However this throws the following error. Could you please let me know how to fix this?
[27-Nov-2021 12:23:39 UTC] PHP Notice: Undefined variable: schema in /var/www/vhosts/xxx.com/httpdocs/wp-content/themes/theme/functions.php on line 724
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
The ticket ‘Using custom code (add_filter) throws errors’ is closed to new replies.