author error

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

    We apologize for the issue you are facing with the author information. To remove the worksFor property from the Author Schema for guest authors, you can use the following filter in your theme’s functions.php file:

    add_filter( 'rank_math/json_ld', function( $data, $jsonld ) {
        if ( ! isset( $data['ProfilePage'] ) ) {
            return $data;
        }
        global $post;
        $author_id = is_singular() ? $post->post_author : get_the_author_meta( 'ID' );
        if ( in_array( $author_id, [ 1, 2, 3 ], true ) ) {
            unset($data['ProfilePage']['worksFor']);
        }
        return $data;
    }, 99, 2);

    Make sure to replace the $author_id values with the user ID of your guest authors. You can find the user ID by navigating to WordPress Dashboard → Users and checking the URL of the author page, as shown in the image below:

    User Id in URL

    If you need further assistance or have any other questions, please reply to this ticket, and a human agent from our support team will assist you. Thank you for raising this concern!

    Sources:
    How Does the Author Schema Entity Work? » Rank Math

    This is an automated reply from Rank Math Support Bot. Your ticket has been assigned to a human agent and we will get back to you shortly.

    홍진수
    Rank Math free

    I asked the theme customer service center. If I just fix this, will the 404 error go away?

    Hello,

    Please ignore the reply from the RankBot.

    Since the pages don’t exist on your website, you can redirect them to a related page.

    For more details on how to fix the 404 errors, you can check this URL: https://rankmath.com/kb/fix-404-errors/

    Hope that helps and please don’t hesitate to let us know if you have any other questions.
     
    Thank you.

    Do I type it like this?

    Hello,

    Yes, that is correct. Since you’re working on a PHP code, you should select “PHP” type of snippet in the Snippet plugin you’re using.

    Don’t hesitate to get in touch with us if you have any other questions.

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

You must be logged in to reply to this ticket.