Add More sameAs schema for Author

#398236
  • Resolved Lawrence Parmisana
    Rank Math free

    Hello,

    I’d like to ask for assistance on confirming what I know as I cannot say that I’m totally code proficient for Php and JSON-LD but I am working on our site’s SEO.

    In respect to Reference 1 cited below, if I place that code filter on the rank-math.php file (or should it be at the functions.php file?), would it pull in data for each author that we have on the site that is a user and their appropriate social media links or would it just have whatever social media links were declared in the code filter?

    We are creating schema for several authors and reviewers that we can plug directly in to each article that we already have and other articles that we want to publish. See this attached image for reference on our problem on to Rank Math not producing the necessary results for links we placed under sameAs
    https://ibb.co/ySNtYnq
    https://ibb.co/44LxWhJ

    We are aiming to have multiple sameAs fields detected under Author and Reviewer. (see sensitive data)

    Reference 1 (https://support.rankmath.com/ticket/add-more-sameas-schema-for-author/)

    add_filter( 'rank_math/snippet/rich_snippet_article_entity', function($entity) {
    if($entity['author']){
    $entity['author']['sameAs'] = [
    'https://twitter.com/RankMath',
    'https://facebook.com/...'
    ];
    }

    return $entity;
    });

    Hoping to hear from you all soon.

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

    Thank you for contacting Rank Math support, and sorry for any inconvenience that might have been caused due to that.

    The filter code should work if you put it inside the rank-math.php file or functions.php. The Social media links will be added as you hard code them in inside the filter. There’s no dynamic way of pulling data from the author page unless you are making use of the custom field for the author pages, you would need to further customize the code if that’s the case.

    As for the schema builder in your screenshot, that feature is only available for the PRO version. Can you please confirm if you are currently using the PRO plugin? If so, kindly share the email address you used to purchase the PRO plugin so we can confirm since you have created this ticket using the Free Rank Math account.

    Looking forward to helping you.

    Hello Jeremy,

    Thanks for the initial reply. As you said, yes we do have the PRO version of Rank Math. Unfortunately, I cannot hand out the email addressed used to purchase the PRO plugin as it is under my client’s account. Would you not be able to assist me without it?

    Can you show me what code filter should I use so that we can show each person (approximately 10) and how can we define them further when creating the schema itself under Schema Templates?

    Hello,

    Unfortunately, we only provide PRO support to PRO tickets, the Schema Templates is a PRO feature so if you wish further assistance with it, kindly create a new ticket using the Rank Math PRO account you have.

    The fields from the custom schema can’t be integrated into the filter so you may need some way to add the sameAs items dynamically in your filter code like adding a custom field. However, this needs further modification of the code.

    Looking forward to helping you.

    The fields from the custom schema can’t be integrated into the filter so you may need some way to add the sameAs items dynamically in your filter code like adding a custom field. However, this needs further modification of the code.

    Can you further elaborate on this? Or at least show what direction we should be going for this one.

    Hello,

    If the data is inside custom fields you need to find a way to retrieve them dynamically with the help of some PHP functions.

    For example, if you are using ACF there’s a function called get_field() from that plugin that fetches the data from the custom field.

    That is just an idea of how this can be achieved.

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

    Hello,

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

    Thank you.

    Hello,

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

    Thank you.

    I edited the Sensitive Data field to include edits I’ve made following from this specific link (https://support.rankmath.com/ticket/adding-custom-author-schema/)

    I’ve used the following instructions on the link, down to the dot, and implemented it directly on a developer site yet it’s still not working. It only works if I used the specific tags “linkedin”, “facebook”, “twitter” instead of “sameAs” and they would display like this (see screenshot) https://ibb.co/bs2v5Ym. The property linkedin is not recognized by the schema (e.g. schema.org) for an object of type Person.

    Is this because the duplicate/development site is not using Rank Math pro right now or am I missing something with the instructions you’ve provided on reference link provided above?

    Hello,

    These modifications are still applicable to the current version of the plugin and you don’t need the PRO plugin for that to work correctly.

    In this case, it’s likely that you added the code snippet wrongly on the website or didn’t follow the instructions to replicate this situation.

    If you would like us to take a look, please edit the first post on this ticket and include your WordPress & FTP logins in the designated Sensitive Data section.

    Please do take a complete backup of your website before sharing the information with us.
    Sensitive Data Section

    It is completely secure and only our support staff has access to that section. If you want, you can use the below plugin to generate a temporary login URL to your website and share that with us instead:

    https://wordpress.org/plugins/temporary-login-without-password/

    You can use the above plugin in conjunction with the WP Security Audit Log to monitor what changes our staff might make on your website (if any):

    https://wordpress.org/plugins/wp-security-audit-log/

    We really look forward to helping 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 9 replies - 1 through 9 (of 9 total)

The ticket ‘Add More sameAs schema for Author’ is closed to new replies.