set schema for author page

#570658
  • Resolved Anonymous
    Rank Math free

    Hello,
    I use Rank Math Pro for my Woocommerce website. I see some Schema code that is automatically added to my author page. Can you guide me to remove that code and replace it with another one? I don’t see the option to remove/add Schema for author pages like other pages
    Thank you

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 any inconvenience this issue may have caused you.

    You mentioned that you’re using Rank Math PRO, but the account you used to open this ticket is the Rank Math free version.

    Can you please search and forward a receipt from FastSpring.com or the email address you used to purchase so we can locate your account and verify it?

    Meanwhile, here’s a filter you can use to remove all the schema applied to your author URLs:

    add_filter( 'rank_math/json_ld', function( $data, $jsonld ) {
    	if(is_author()) {
    		return [];
    	}
    	return $data;
    }, 99, 2);

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

    Hope that helps.

    Thank you.

    Anonymous
    Rank Math free

    Hello,
    I have successfully removed the Schema snippet using the Code Snippets plugin. Can you guide me to insert a new code snippet for that author page? I asked you from last time and didn’t see you mentioned.
    Thank you

    Hello,

    Apologies for missing that part.

    The schema on your author pages will be removed by using that filter completely, even if you have used the Schema Templates.

    However, there’s a filter you can customize further if you wanted to remove each of the properties:

    add_filter( 'rank_math/json_ld', function( $data, $jsonld ) {
    	if( is_author() || ! isset( $data['publisher'] )) {
    		return $data;
    } 
    unset($data['publisher']);
    unset( $data['place'] );
    unset($data['ProfilePage']);
    unset($data['WebPage']);
    	return $data;
    }, 99, 2);

    This filter can be used to remove Schema markup as we did previously but it can also be used to update the existing one which is what you want to do in this case.

    You would need to edit this filter extensively to update the properties from those types of Schema.

    Hope that 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 ‘set schema for author page’ is closed to new replies.