-
Hi,
I am using this code:
/**
* Filter: Remove/modify schema data.
*
* @param array $return Array of json-ld data.
*/
add_filter( ‘rank_math/json_ld’, function( $data, $json ) {
if ( is_home() && isset( $data[‘Blog’] ) ) { // Remove Blog Snippet from homepage.
unset( $data[‘Blog’] );
}
return $data;
}To remove the Blog snippet from homepage. I am getting the below error,
Stack trace:
#0 wp-includes/class-wp-hook.php(289): {closure}(Array)
#1 wp-includes/plugin.php(249): WP_Hook->apply_filters(Array, Array)
#2 wp-content/plugins/seo-by-rank-math/includes/traits/class-hooker.php(103): apply_filters_ref_array(‘rank_math/json_…’, Array)
#3 wp-content/plugins/seo-by-rank-math/includes/modules/rich-snippet/class-jsonld.php(77): RankMath\RichSnippet\JsonLD->do_filter(‘json_ld’, Array, Object(RankMath\RichSnippet\JsonLD))
#4 wp-includes/class-wp-hook.php(287): RankMath\RichSnippet\JsonLD->json_ld()
#5 wp-includes/class-wp-hook.php(311): WP_Hook->apply_filters(NULL, Array)
#6 wp-includes/plugin.php(544): WP_Hook->do_action(Array)Could you please help me regarding the same?
The ticket ‘Remove Blog Snippet from Home Page’ is closed to new replies.