Meta description showing excerpt

#12354
  • Resolved Rick1963
    Rank Math pro
    Content AI Starter

    I’ve customized the meta description for a post type, using placeholder text and %title%. This description shows on the dashboard for all the posts. However, inside the actual post and on the web page, it’s showing the excerpt.

    • This topic was modified 5 years, 3 months ago by Rick1963.
Viewing 14 replies - 1 through 14 (of 14 total)
  • Hello,

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

    This is a bit unexpected, would you mind sharing some screenshots of how this looks on the backend along with a link to one of the affected pages so that we can advise further?

    Looking forward to helping you. Thank you.

    ​​​​​​​

    Rick1963
    Rank Math pro
    Content AI Starter

    I would love to. How do I share screenshots. I don’t see any way to attach images!

    Hi Rick,

    Please edit the sensitive data section and share some links from Google Drive or any image sharing platform such as https://snag.gy/

    I hope this info helps. Thank you.

    Rick1963
    Rank Math pro
    Content AI Starter

    Is there an easier method?

    Hello,

    You can also edit the first post on this ticket and include your WP logins in the designated Sensitive Data section so that we can check this first hand.
    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.

    Rick1963
    Rank Math pro
    Content AI Starter

    Hello,

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

    Thank you.

    Hi there,

    Thanks for the patience.

    It looks like there is some code that is interfering with the generation of the description for this post type on your site. I have however added the following snippet on your theme to override this:

    add_filter( 'rank_math/frontend/description', function( $description ) {
        if ( is_singular( 'listings' ) ) {
            //global $post;
            $value = RankMath\Helper::get_settings( 'titles.pt_listings_description' );
            return '' !== $value ? RankMath\Helper::replace_vars( $value, [] ) : '';
            
        }
    
        return $description;
    });

    I hope this info helps. Thank you.

    Rick1963
    Rank Math pro
    Content AI Starter

    “some code interfering”… will this be fixed in a future release of Rank Math, so I don’t have to rely on custom code?

    Rick1963
    Rank Math pro
    Content AI Starter

    Also, it would be helpful if you had added a comment with code to explain the purpose.

    Rick1963
    Rank Math pro
    Content AI Starter

    Also, does this code override all meta description settings for all post types?

    Hi Rick,

    This feature works as expected on my end, it is not a Rank Math issue.
    You may want to perform a conflict test to isolate what is causing this on your end to avoid using the code: https://rankmath.com/kb/check-plugin-conflicts/

    Apologies for the missing comments, I have added the comments as shown below:

    /*
     * Code to check the meta description that is set on the Rank Math
     * Titles & Meta > Factoring listing description and return it
     * for single listings
     */
    add_filter( 'rank_math/frontend/description', function( $description ) {
        if ( is_singular( 'listings' ) ) {
            //global $post;
            $value = RankMath\Helper::get_settings( 'titles.pt_listings_description' );
            return '' !== $value ? RankMath\Helper::replace_vars( $value, [] ) : '';
            
        }
    
        return $description;
    });
    

    Thank you.

    Rick1963
    Rank Math pro
    Content AI Starter

    very strange

    Rick1963
    Rank Math pro
    Content AI Starter

    If I had a dollar for every support response that blames it on plugin conflict, I wouldn’t need to be doing all this in the first place.

    Hi Rick,

    I understand your frustration. This is the most common cause of broken functionality since some plugins do not use WP standards during development.

    Please let us know if we can offer additional help. 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 14 replies - 1 through 14 (of 14 total)

The ticket ‘Meta description showing excerpt’ is closed to new replies.