How to remove author from schema and change article > webpage

[ad_1]

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

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer