How to remove author name of star rating?

#277600
Viewing 14 replies - 1 through 14 (of 14 total)
  • Hello,

    Thank you for contacting Rank Math and bringing your concern to our attention.

    You may need to use a filter to remove the author from your product schema. Please refer to the code below and insert it into your theme’s functions.php file:

    /**
     * Filter to change the schema data.
     * Replace $schema_type with schema name like article, review, etc.
     *
     * @param array $entity Snippet Data
     *
     * @return array
     */
    add_filter( "rank_math/snippet/rich_snippet_product_entity", function ( $entity ) {
    	if ( isset( $entity['author'] ) ) {
    		unset( $entity['author'] );
    
    		return $entity;
    	}
    
    	return $entity;
    } );

    You can then test your URL with Google Rich results test tool to see if the info has been removed under product schema.

    Hope this helps you. Looking forward to helping you.

    Thank you.

    Hi thanks for the fast reply.

    I added it to my functions.php file, but in the testing tool I still see the review author.

    Hello,

    Please clear cache from your website in case you are using a cache plugin and also from your browser. Then run the test again.

    Hope this helps you. Looking forward to your update.

    Thank you.

    I cleared Cloudflare and WP Rocket and still see it. Any idea why?

    I still see it in the schema markup validator, I don’t mean Google search of course 🙂

    Hello,

    We might need to take a closer look at the settings. Please edit the first post on this ticket and include your WordPress login in the designated Sensitive Data section.

    Please do take a complete backup of your website before sharing the information with us.
    Sensitive Data Section

    It is completely secure and only our support staff has access to that section. If you want, you can use the below plugin to generate a temporary login URL to your website and share that with us instead:

    https://wordpress.org/plugins/temporary-login-without-password/

    You can use the above plugin in conjunction with the WP Security Audit Log to monitor what changes our staff might make on your website (if any):

    https://wordpress.org/plugins/wp-security-audit-log/

    We really look forward to helping you.

    Hello,

    I have updated the sensitive data as requested. Can you please check further?

    Thank you.

    Hello,

    The author property is a required one for the Review Schema as is stated in the Google guidelines so you can’t remove that if you want to have compliant Schema.
    https://developers.google.com/search/docs/advanced/structured-data/review-snippet

    What you can do is change the name and URL of the author by applying and modifying this code:

    
    add_filter( 'rank_math/snippet/rich_snippet_product_entity', function( $entity ) {
        $entity['review'][0]['author']['name'] = 'My Name';
        $entity['review'][0]['author']['url'] = 'https://google.com';
        return $entity;
    });
    

    Hope this helps clarify your doubts.

    Don’t hesitate to get in touch if you have any other questions.

    Hi Miguel,

    that makes sense.

    For all other pages that rank for the same keyword you see:

    stars Rating: 5 . number of reviews

    and mine is:

    stars Rating: 5 . Review by Author

    Do you know how to change that?

    I will add a few of the other websites into the sensitive data section.

    Hello,

    All of those websites have more than a single review and when that happens Google stops displaying the name to show the number of reviews available for that product.

    The name is only displayed if there is a single review on the page.

    Hope this helps clarify your doubts.

    Don’t hesitate to get in touch if you have any other questions.

    Hi Miguel,

    is this not possible with Rank Math and a little PHP?

    Kind regards,
    Daniel

    Hello,

    As mentioned previously the author is a required property for the Review Schema and as such, we can’t remove it from this type of Schema markup.

    The only thing we can control is the name and URL which we want to attach with the author of this review and that can be done with the filter we mentioned earlier.

    We also noted that the Review on this has been added in the Schema Generator directly and to change the author on that the code needs to be modified to the following:

    
    add_filter( 'rank_math/snippet/rich_snippet_product_entity', function( $entity ) {
        $entity['review']['author']['name'] = '13 Kunden';
        $entity['review']['author']['url'] = 'https://danielvoelk.de/bewertungen/';
        return $entity;
    });
    

    Hope this helps clarify your doubts and solve the issue.

    Don’t hesitate to get in touch if you have any other questions.

    Ok, yeah that’s what I added already.

    Thanks 🙂

    Hello,

    Glad that helped.

    Please feel free to reach out to us again in case you need any other assistance.

    We are here to help.

    Thank you.

Viewing 14 replies - 1 through 14 (of 14 total)

The ticket ‘How to remove author name of star rating?’ is closed to new replies.