rich snippets fields (Article)

#2818
  • Resolved Gemuz
    Rank Math free

    In the description field is only possible option %excerpt%.
    I need to have a field analog description of the post.
    You must automatically add a description of the first 160 characters or written by hand.
    Priority: manual description, and if there is no manual, then use 160 characters from the post.
    It worked great for yoast seo.

    • This topic was modified 5 years ago by Gemuz.
Viewing 11 replies - 1 through 11 (of 11 total)
  • Michael Davis
    Rank Math pro

    Hello,

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

    It is also possible to override the description of your posts through the Rank Math meta box, please navigate to the General tab and click on edit snippet. You can then enter the custom description on the meta description text box and save. Please refer to the following screenshot: https://snag.gy/p4Q5Ak.jpg

    I hope this info helps. Thank you.

    ​​​​​​​

    Gemuz
    Rank Math free

    This problem was due to incorrect migration from past seo plugins.
    Problem solved by editing Custom Field

    How to fix a bug in rich snippets Article. Test page in the screened information.

    Michael Davis
    Rank Math pro

    Hello,

    Thank you for the follow up.

    The error on the structured data testing tool suggests that you are using very long titles for your posts that might affect the rankings on your content. I would suggest that you truncate the titles to the recommended range of 0-110.

    I hope this info helps. Thank you.

    ​​​​​​

    Gemuz
    Rank Math free

    Can the plugin do this automatically?
    Similar to the description with a limit of 160 characters.

    Michael Davis
    Rank Math pro

    Hi there,

    Thanks for the follow up.

    Yes, you can add the following code to your theme’s functions.php file:

    /**
     * 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_article_type", function( $entity ) {
            $char_count 	= 110; // number of characters
    	
    	$entity['headline'] = mb_strimwidth( $entity['headline'], 0, $char_count, '');
    		 
    	
    	return $entity;
    });

    I hope this info helps.

    Todd
    Rank Math free

    Hi Gemuz,

    Unfortunately, we do not truncate your meta title. Sorry.

    I will ask the dev. team and see if there is a filter to attain that.

    I will get back to you.

    Gemuz
    Rank Math free

    The script does not work. Waiting for a decision.

    Todd
    Rank Math free

    Hello,

    Please check here:
    https://rankmath.com/kb/filters-hooks-api-developer/#change-the-title

    You can use this filter and wp_trim_words to change trim the title.
    https://developer.wordpress.org/reference/functions/wp_trim_words/

    Hope that helps and please do not hesitate to let us know if you need our assistance with anything else.

    Gemuz
    Rank Math free

    wp_trim_words() – this is the number of words

    For what reason does the code above not work?

    Can change the code in the plugin to trim the title? In most topics I saw that they themselves forcibly cut the title.

    Gemuz
    Rank Math free

    https://ibb.co/9pzdhSxcode editing

    I changed the code myself.
    It would be nice to see similar code in the next update of the plugin.

    Todd
    Rank Math free

    Hi Gemuz,

    Thanks and I am glad you were able to fix the issue.

    We will see about offering it in the plugin itself but I am not sure how helpful that would be the majority of the users. We will definitely consider it.

    Thank you.

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

The ticket ‘rich snippets fields (Article)’ is closed to new replies.