Remove author from code

#1003483
  • Resolved Abderrahmane Fath
    Rank Math free

    Hello,

    I whave the newspaper theme by tagdiv with the acf plugin installed on my wordpress website. When I view page source I find this code that I want to be removed :

    <span class="td-page-meta" itemprop="author" itemscope itemtype="https://schema.org/Person">
    <meta itemprop="name" content="Name of the author">
    <meta itemprop="url" content="https://example.com/author/nameoftheauthor/">
    </span>

    Thank you in advance!

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

    We apologize for the issue you are facing with the author schema appearing in your page source. To remove the author schema from your WordPress site, you can use a code snippet that targets the specific schema data you want to eliminate. Here’s a general approach you can take:

    Code Snippet to Remove Author Schema

    You can add the following code snippet to your theme’s functions.php file:

    add_filter( 'rank_math/json_ld', function( $data, $jsonld ) {
        if ( isset( $data['author'] ) ) {
            unset( $data['author']); // Remove author schema
        }
        return $data;
    }, 99, 2);

    How to Add the Snippet

    1. Navigate to WordPress Dashboard → Appearance → Theme File Editor.
    2. Open the functions.php file of your active theme.
    3. Paste the above code at the end of the file and save changes.

    Important Note

    Make sure to back up your site before making any changes to the code. If you’re not comfortable editing the code yourself, we recommend reaching out to a developer for assistance.

    If you continue to see the author schema after implementing this change, please reply to this ticket with your site URL so we can assist you further.

    Thank you for raising this concern! We’re here to help.

    Sources:
    Removing Schema From Your Posts & Pages » Rank Math

    Hello,

    The filter will not work because this code is not added by the Rank Math plugin. If you’re not sure which plugin/theme is adding this, you can follow this troubleshooting guide to identify: https://rankmath.com/kb/check-plugin-conflicts/

    You can also follow the steps in this video:
    https://www.youtube.com/watch?v=FcIWRhcUP2c

    Only the site admin would know and your users won’t be affected by this troubleshooting.

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

    Hello,

    Thank you so much for your help!

    Hello,

    We are glad that helped.

    Can you please confirm if you still need our assistance with anything else or we can close the ticket?

    Looking forward to hearing back from you.

    Thank you.

    Hello,

    Thank you for your help. I no longer need assistance as I’ve contacted the theme support, hopefully the code is coming from there.

    Thanks again!

    Hello,

    Let us know how it goes.

    Meanwhile, if you have any other questions, please feel free to ask.

    We are here to help you.

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

You must be logged in to reply to this ticket.