remove written by from schima

#324124
  • Resolved Andrew Haberman
    Rank Math free

    Whenever I post a link to a clients site it says written by and uses the authors name (in most cases its myself) is there anyways to remove this from the schima?

Viewing 8 replies - 1 through 8 (of 8 total)
  • Kamlesh
    Rank Math free

    Hello,

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

    The author is a required part of the article schema which is usually taken from the settings of the user who publishes the post.

    You can check out this article by google on structured data types: https://developers.google.com/search/docs/data-types/article

    However, if you wish to proceed with removing the author, 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.

    Hope this helps.

    Looking forward to helping you.

    Thank you.

    Andrew Haberman
    Rank Math free
    /**
     * 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_article_entity", function ( $entity ) {
    	if ( isset( $entity['author'] ) ) {
    		unset( $entity['author'] );
    
    		return $entity;
    	}
    
    	return $entity;
    } );

    this doesn’t work, its still showing written by in the preview links

    Hello,

    Could you please share the affected URL so we can check as well?

    Looking forward to helping you.

    Thank you.

    Andrew Haberman
    Rank Math free

    Hello,

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

    Thank you.

    Andrew Haberman
    Rank Math free

    added

    Hello,

    Could you please confirm if you are referring to the author under the WebPage schema? If so, you may use this filter as well:

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

    Let us know how that goes. Looking forward to helping you with this one.

    Andrew Haberman
    Rank Math free

    honestly all I had to do was unlock the enhanced slack schema…found it on my own thanks

    Hello,

    Glad that everything is sorted now.

    Please feel free to reach out to us again in case you need any other assistance.

    We are here to help.

    Thank you.

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

The ticket ‘remove written by from schima’ is closed to new replies.