Hello,
We apologize for the inconvenience you’re experiencing with setting the default product description in Rank Math.
To set a default product description for new products, you can use the SEO description field in the Rank Math metabox. Here’s how to do it:
- Head over to WordPress Dashboard → Products and click Edit on the product you want to set the default description for.
- Scroll down to the Rank Math SEO metabox and click Edit Snippet.
- In the Description field, enter the default product description you’d like to use.
If you’re creating a new product, you can follow the same steps to set the default product description using the SEO description field.
If you’ve already tried this and it’s not working as expected, please let us know, and we’ll be happy to assist you further.
Thank you for reaching out to us!
Sources:
How to Set Product Meta Description Using Rank Math » Rank Math
Rank Math ‘Titles and Meta’ Options and Settings
Using Variables in the SEO Title and Description » Rank Math
HI,
I would like to define a template for the description, so that I already have the product description when I create a new product without having to rewrite it from scratch.
I see that the short description in product snippet bypass the “single product description”, when I don’t insert the short description it is used the “single product description”.
I need to have a custom short description that I insert manually, and a seo description (“single product description”) that is the same for all the products.
I tried to add the below custom filter but it messed up with my theme (porto – tested in main and child directory).
/**
* Use the Description from Global Setting, if the description is missing in the Post metabox
*/
add_action( ‘rank_math/frontend/description’, function( $description ) {
global $post;
$desc = RankMath\Post::get_meta( ‘description’, $post->ID );
if ( is_product()) {
$desc = RankMath\Helper::get_settings( “titles.pt_{$post->post_type}_description” );
if ( $desc ) {
return RankMath\Helper::replace_vars( $desc, $post );
}
}
return $description;
});
Hello,
Thank you for your patience.
The code you have shared is correct and should prioritize the meta description from Titles & Meta > Products > Single Product description.
Please ensure that you have inserted the code in your theme’s functions.php file.
Here are some alternatives you can follow to apply the filter:
https://rankmath.com/kb/wordpress-hooks-actions-filters/
Let us know how this goes.
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.