how to remove author

#232703
  • Resolved Beauty Secrets
    Rank Math free

    Hello,

    Im checking my snippets and i saw it has many many repeated information plus author information which is admin and i dont think its helping with nothing its possible to keep the important only ?

    another question i dont know if you can help me with it i have products from march it has reviews and now am checking in google its not showing that it has review , my home page as well not showing the correct title on google is google not getting the updated pages from my website ?

    Best regards

Viewing 11 replies - 1 through 11 (of 11 total)
  • Ankit
    Rank Math business

    Hello,

    Thank you for contacting Rank Math and bringing your concern to our attention.

    You may need to use a filter to remove the author schema. Please refer to the code below and insert it into your theme’s functions.php file:

    /**
     * Filter to change the schema data.
     * Replace $schema_type with schema name like article, review, etc.
     *
     * @param array $entity Snippet Data
     *
     * @return array
     */
    add_filter( "rank_math/snippet/rich_snippet_{$schema_type}_entity", function ( $entity ) {
    	if ( isset( $entity['author'] ) ) {
    		unset( $entity['author'] );
    
    		return $entity;
    	}
    
    	return $entity;
    } );

    Please note you need to change the {$schema_type} to the object type you wish to modify.

    another question i dont know if you can help me with it i have products from march it has reviews and now am checking in google its not showing that it has review , my home page as well not showing the correct title on google is google not getting the updated pages from my website ?

    The Structured Data Testing Tool is being deprecated. For validating structured data for Google Search, Google now recommends using the Rich Results Test. I am able to see the review snippet in the schema.

    Google stated: “Google does not guarantee that features that consume structured data will show up in search results. For a list of common reasons why Google may not show your content in a rich result”

    You can learn more about it here:
    https://developers.google.com/search/docs/data-types/review-snippet#troubleshooting

    In regards to different meta title, ​Do note that if everything’s fine and Google still decides to show a different meta title/description for your search keyword, there is nothing you can do as Google sometimes ignores the custom meta info altogether and show something from the page’s content that matches the search intent better.

    The best you can do is optimize your meta tags to try and match the intent of the search/keyword.

    You can read more about it here

    https://support.google.com/webmasters/answer/35624?hl=en

    If you require any further assistance don’t hesitate to get in touch. Thanks

    Hello,

    Id like to remove author because i dont think its needed so i put the code which u gave me nothing change still have author !

    best regards

    Hello,

    In this case, we may need to check your admin dashboard and see why the filter does not work. 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,

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

    Thank you.

    Hello,

    Checking the filter you have added in your theme functions.php file, it seems you didn’t specify the type of schema. Please see this screenshot: https://i.rankmath.com/OzfPw7

    I have changed it to article since most of your schemas are article types. Please check if this resolves the issue.

    We are looking forward to helping you.

    Hello,

    Still author showing on.

    Hello,

    The author property is required as per Google guidelines to be included in the Article Schema or any subset of those such as BlogPosting or NewsArticle.
    https://developers.google.com/search/docs/data-types/article

    Because of that, you can’t remove the author data from the Article Schema.

    Hope this helps clarify your doubts.

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

    Hello,

    I understand your point but my website it’s shop online it’s not blog , so I don’t think for my products it’s need these information .

    Best regards

    Hello,

    If you are trying to remove that information from your product pages you can use the following filter:

    
    add_filter( 'rank_math/json_ld', function( $entities, $jsonld ) {
    	if ( ! is_singular( 'product' ) ) {
    		return $entities;
    	}
    	if ( isset( $entities['ProfilePage'] ) ) {
    		$id = $entities['ProfilePage']['@id'];
    		foreach ( $entities as $key => $entity ) {
    			if ( isset( $entity['author' ]['@id'] ) && $id === $entity['author' ]['@id'] ) {
    				unset( $entities[ $key ]['author'] );
    			}
    		}
    		unset( $entities['ProfilePage'] );
    	}
    	return $entities;
    }, 999, 2 );
    

    Hope this helps solve your issue.

    Don’t hesitate to get in touch if you require any further assistance.

    Hello,

    thank you its working do i need to keep this code as well ,

    /**
     * Filter to change the schema data.
     * Replace $schema_type with schema name like article, review, etc.
     *
     * @param array $entity Snippet Data
     *
     * @return array
     */
    add_filter( "rank_math/snippet/rich_snippet_{$schema_type}_entity", function ( $entity ) {
    	if ( isset( $entity['author'] ) ) {
    		unset( $entity['author'] );
    
    		return $entity;
    	}
    
    	return $entity;
    } );

    Hello,

    You can remove that filter since the code that my colleague shared above should remove the author details from your site.

    I hope that helps.

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

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

The ticket ‘how to remove author’ is closed to new replies.