How to remove author from schema and change article > webpage
-
Hi,
I am trying to remove all author metadata from my blog posts. I have tried this code from https://rankmath.com/blog/remove-the-author-name-wordpress/:
add_filter(“rank_math / snippet / rich_snippet_article_entity”, function ( $entity ) {
if ( isset( $entity[‘author’] ) ) {
unset( $entity[‘author’] );
return $entity;
}
return $entity;
});But it is throwing this error:
Your PHP code changes were rolled back due to an error on line 151 of file wp-content/themes/generatepress-child/functions.php. Please fix and try saving again.
Uncaught Error: Undefined constant ““rank_math” in wp-content/themes/generatepress-child/functions.php:151
I would also like to change the schema type for all blog posts from Article to webPage. However there is no option to set this here: /wp-admin/admin.php?page=rank-math-options-titles
Thanks
- The topic ‘How to remove author from schema and change article > webpage’ is closed to new replies.