Schema author

#233132
  • Resolved Lara
    Rank Math free

    Hi,
    I run a single-author site. My author page redirects to the homepage to avoid duplicate content. Once I installed Rank Math, my author page URL started appearing in the schema data. I’m not sure there are any benefits to this at this point (are there any?).
    Can the author page URL (as well as the gravatar link – I don’t use gravatar) be removed from schema?
    Thanks!

Viewing 3 replies - 1 through 3 (of 3 total)
  • 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.

    Those fields are required in the Article Schema to make it compliant and pass the tests in the Rich Results Test tool.

    However, you can edit the @id of your author by adding the following filter on your site:

    add_filter( 'rank_math/json_ld', function( $data, $jsonld ) {
        if ( ! isset( $data['ProfilePage'] ) ) {
            return $data;
        }
    
        $data['ProfilePage']['@id'] = 'your-new-id-here';
        $data['WebPage']['author']['@id'] = 'your-new-id-here';
        return $data;
    }, 99, 2);

    And here’s a link to how to apply this to your site:
    https://rankmath.com/kb/filters-hooks-api-developer/#adding-filters-and-hooks-in-rank-math-php

    I hope that helps.

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

    Lara
    Rank Math free

    Hi Reinelle,

    I’m a bit puzzled by this. I don’t understand what the new ID should be…
    As I said, my author archive page redirects to the homepage. So I have no author archive page per se.

    Hello,

    Sorry for the confusion.

    The filter above lets you customize/rename the ID field. If you wanted those to be removed, you would need like this one instead:

    add_filter( 'rank_math/json_ld', function( $data, $jsonld ) {
        if ( ! isset( $data['ProfilePage'] ) ) {
            return $data;
        }
        unset( $data['ProfilePage']['@id'] );
        unset( $data['WebPage']['author']['@id'] );
        return $data;
    }, 99, 2);

    I hope this helps.

    Thank you.

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

The ticket ‘Schema author’ is closed to new replies.