Remove Author Schema Markup

#175249
  • Resolved mario camacho
    Rank Math free

    Hello,

    Hi, I would like to completely remove the schema markup for the author field on my site pages, as the theme used already marks this function correctly and the Rank Math markup causes error.

    In another reply I saw the recommendation to include this code in the functions.php file but it has not worked:

    /**
    * 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_article_entity", function( $entity ) {
    if(isset($entity[author])){
    unset($entity[author]);
    return $entity;
    }
    return $entity;
    });

    Can you tell me the way to disable this markup?
    Thank you very much

Viewing 4 replies - 1 through 4 (of 4 total)
  • Anonymous
    Rank Math free

    Hello,

    Thank you for contacting Rank Math and bringing your concern to our attention. I’m sorry for the delay and for any inconvenience this issue may have caused you.

    The code you shared, has a little issue, here I am sharing the correct one. But remember, this code will work only for the article object. So please be careful for which object type you want to remove the author field.

    /**
     * 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_article_entity", function ( $entity ) {
    	if ( isset( $entity['author'] ) ) {
    		unset( $entity['author'] );
    
    		return $entity;
    	}
    
    	return $entity;
    } );

    If you require any further assistance don’t hesitate to get in touch. Thanks

    mario camacho
    Rank Math free

    Hello,

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

    Thank you.

    mario camacho
    Rank Math free

    Hello, thank you for your reply. I see that I keep getting error in the author field in the google schema tool.
    I would need it to either not identify that field, so it doesn’t think the tag is empty, or it would take the information in the same way the template does.

    I send you the link to the test as hidden content, so you understand what I mean. I don’t understand why the author field inside the article gives error.

    Hello,

    Thank you for the follow-up, and sorry for the delay.

    I’ve checked the URL using Google’s Rich Results test, and it seems that it is already working fine.

    The Structured Data Testing Tool is being deprecated. For validating structured data for Google Search, Google now recommends using the Rich Results Test for more accurate and actionable feedback.

    I hope that helps. Thank you, and please don’t hesitate to contact us anytime if you need further assistance with anything else.

    Hello,

    Since we did not hear back from you for 15 days, we are assuming that you found the solution. We are closing this support ticket.

    If you still need assistance or any other help, please feel free to open a new support ticket, and we will be more than happy to assist.

    Thank you.

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

The ticket ‘Remove Author Schema Markup’ is closed to new replies.