RankMath deletes meta description

#406118
  • Resolved Harald
    Rank Math free

    With the Extra Theme (by Elegant Themes) I added a meta description to the home page of my website.
    If I deactivate RankMath, the description is displayed correctly in the source code. But when RanMath is activated, the description is missing. And I can’t find a way to access the start page with RankMath to enter a description there.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Anas
    Rank Math business

    Hello,

    Thank you for contacting Rank Math, and sorry for any inconvenience caused.

    Are you are using Custom Layout as your Homepage?

    If yes, Rank Math would not able to set the description on the homepage.

    In this case, you can change the Homepage description by adding this filter in the theme’s functions.php file:

    add_filter( 'rank_math/frontend/description', function( $description ) {
    	$description = 'ABC';  //Replace ABC with the meta description 
    	return $description;
    });

    Here is a guide you can follow to add the filter:
    https://rankmath.com/kb/wordpress-hooks-actions-filters/#functions-php-file

    Hope that helps.

    Thank you.

    Harald
    Rank Math free

    Thanks! The meta description is now displayed in the home page source code. Unfortunatly, the filter now also overwrites all meta descriptions of apparently every single post page, which were previously individual. Now the same description is everywhere. I’m looking for a solution for the home page only.

    Hello,

    Could you please update the filter to target only your homepage?

    add_filter( 'rank_math/frontend/description', function( $description ) {
     if ( is_home()){
    	$description = 'ABC';  //Replace ABC with the meta description 
    }
    	return $description;
    });

    Let us know how this goes.

    Thank you.

    Harald
    Rank Math free

    It works. Thank you very much!

    Hello,

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

    If you don’t mind us 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 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.

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

The ticket ‘RankMath deletes meta description’ is closed to new replies.