I want to replace @Person to @Organization in article schema

#498710
  • Resolved USM LoveLy
    Rank Math free

    We all know that in the schema of an article, rank math pulls the author’s details.

    But, for a few sites, I want to represent my organization as an author. So, in Article Schema > author > @type, I want to replace Person with Organization

    How can I do this?

    Thanks.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Hello,

    Thanks for contacting us, and sorry for any inconvenience that might have been caused due to that.

    You can add the following filter on your website and change the data according to your needs to update the author in the Article Schema:

    
    add_filter( "rank_math/snippet/rich_snippet_article_entity", function( $entity ) {
        $entity['author']['@id'] = 'https://rankmath.com/#organization';
        $entity['author']['@type'] = 'Organization';
        $entity['author']['name'] = 'Rank Math';
        return $entity;
    });
    

    Here’s how you can add filters/hooks to your WordPress site:
    https://rankmath.com/kb/wordpress-hooks-actions-filters/

    Hope that helps, and please do not hesitate to let us know if you need our assistance with anything else.

    Thank you.

    Thank you, it is working fine and it is what exactly I was looking for.

    However, if I try to make it dynamic like if I replace https://rankmath.com/#organization with %org_url% and similar for the organization name, it didn’t work well. It shows %org_url% as output!

    Am I doing something wrong or it cannot be dynamic?

    Hello,

    Those variables will not work in the snippet. However, the URL and the name of the organization should be the same for every article on your site. The URL should be your site’s URL/#organization so you can set it manually in the snippet.

    Let us know if you need any other assistance.

    That you a lot.

    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 5 replies - 1 through 5 (of 5 total)

The ticket ‘I want to replace @Person to @Organization in article schema’ is closed to new replies.