Rich Snippet Book – How to modify the description?

#22645
  • Resolved Jens Fischer
    Rank Math free

    Hi,
    When using the book template for rich snippets, there is no field for “Description”. But obviously Rank Math is pulling some info into the snippet, in my case it’s a truncated excerpt and the featured image.
    How can I control/deactivate that?

    Thanks in advance,
    Jens

Viewing 5 replies - 1 through 5 (of 5 total)
  • Michael Davis
    Rank Math pro

    Hello,

    Thank you for contacting Rank Math today.

    It is possible to customize the returned data for each snippet by making use of the following filter:

    /**
     * Filter to Short-circuit Schema if a 3rd party is interested in generating their own data.
     * Replace $schmea_type with schema name like article, review, etc.
     * @param array $entity Snippet Data
     * @return array
     */
    add_filter( "rank_math/snippet/rich_snippet_book_entity", function( $entity ) {
     //target a certain page using its id
     if(is_page('123')){
        $entity['image']['url'] = 'image url here';
        $entity['image']['width'] = '1100';
        $entity['image']['height'] = '856';
        return $entity;
     }
     return $entity;
    });

    I am however not sure what you mean by description since the returned schema data does not have a description.

    Looking forward to helping you. Thank you.

    ​​​​​​

    Jens Fischer
    Rank Math free

    Hello Michael Davis, thank you for your reply.
    That is not exactely what I’m looking for.
    In the rich snippet for books as it is without any modification there appears some text underneath the title. This text is what I named “Description”. This texts seems to be pulled in from the article – it’s the first words of the article. How can I control this text without altering the whole article?
    Thanks,
    J

    Michael Davis
    Rank Math pro

    Hi Jens,

    Thanks for the clarification.

    You can easily edit the meta description for each post by clicking on the “Edit snippet” button as shown below:
    Edit snippet
    Next, enter a custom meta description on the last field as shown below:
    Meta description

    Please note that you can also control the global variable that is used to auto generate the description for this post type by heading over to WP Dashboard > Rank Math > Titles & Meta > Books > Single Meta description
    You can then select a variable that is used to generate the description since it is currently set to %excerpt%

    I hope this info helps. Thank you.

    Jens Fischer
    Rank Math free

    Ok, so if i got it right the snippet will always display the same “description” as shown in the SERP?

    WP Dashboard > Rank Math > Titles & Meta > Books > Single Meta description

    BTW: I dont have a tab for “books” under titles & meta

    Michael Davis
    Rank Math pro

    Hello,

    Thank you for contacting Rank Math today.

    Yes this description is what will be displayed on the SERP.
    In my last response my assumption was that “Book” is the name of the post type that you were currently editing. Please click on the right post type on the left menu and edit the meta info.

    Looking forward to helping you. Thank 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 5 replies - 1 through 5 (of 5 total)

The ticket ‘Rich Snippet Book – How to modify the description?’ is closed to new replies.