Global Meta Description

#78646
  • Resolved Arona LK
    Rank Math free

    Hi,

    Could you let me know how to set up a global meta description? Which applies to all the pages till changed separately.

    Thanks,
    Thisura

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hello,

    Thank you for contacting Rank Math today.

    Just head to Rank math > Titles & Meta > and modify your​​​​​​ pages description then add the following filter to your theme functions.php:

    /**
     * Use the Description from Global Setting, only if the description is missing in the Post metabox
     */
    add_action( 'rank_math/frontend/description', function( $description ) {
     global $post;
     $desc = RankMath\Helper::get_settings( "titles.pt_{$post->post_type}_description" );
     if ( $desc ) {
     return RankMath\Helper::replace_vars( $desc, $post );
     }
    
     return $description;
    });
    

    Looking forward to helping you. Thank you.

    This worked like magic.

    Superb service.

    • This reply was modified 3 years, 9 months ago by Arona LK.

    Hello,

    We are super happy that this resolved your issue. If you have any other questions in the future, know that we are here to help you.

    If you don’t mind me asking, could you please leave us a review (if you haven’t already) on https://wordpress.org/support/plugin/seo-by-rank-math/reviews/#new-post about your overall experience with Rank Math? We appreciate your time and patience.

    If you do have another question in the future, please feel free to create a new forum topic, and it will be our pleasure to assist you again.

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

The ticket ‘Global Meta Description’ is closed to new replies.