Customize json author in structured data

#61919
  • Resolved Arnaud Baudry
    Rank Math free

    Hello,
    The json code pulls the author from the WordPress author field, which for us is the handling editor, not the author of an article.
    The author (contributor) of an article is stored in a custom taxonomy.
    Do you have a filter we could use to easily modify this?
    Thanks,
    Arnaud

    • This topic was modified 3 years, 10 months ago by Arnaud Baudry. Reason: added info to sensitive data box
Viewing 4 replies - 1 through 4 (of 4 total)
  • Hello,

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

    Thank you.

    Alberto
    Rank Math business

    Hello,

    Please use following filter to change the author value in Article Schema:

    add_filter( 'rank_math/snippet/rich_snippet_article_entity', function( $entity ) {
        $entity['author'] = [
    	'@type' => 'Person',
    	'name'  => 'Author Name',
        ];
    
        return $entity;
    });

    I hope that helps.

    Thank you!

    Hello,

    We are super happy that this resolved your issue. If you have any other questions in the future, know that we are here to help you.

    If you don’t mind me asking, could you please leave us a review (if you haven’t already) on https://wordpress.org/support/plugin/seo-by-rank-math/reviews/#new-post about your overall experience with Rank Math? We appreciate your time and patience.

    If you do have another question in the future, please feel free to create a new forum topic, and it will be our pleasure to assist you again.

    Thank you.

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

The ticket ‘Customize json author in structured data’ is closed to new replies.