-
Hi,
Can you let me know how I can change the default snippet for Woocommerce products from Product Short Description to Product Description ?
-
Hello,
We apologize for the issue you are facing. To change the default snippet for WooCommerce products from the Product Short Description to the Product Description, you can use the following variable in your SEO title or description settings:
- For the Product Description, you can use the variable
%wc_description%
.
This will allow you to display the full product description instead of the short description. You can set this up in the Rank Math settings for your WooCommerce products.
If you need further assistance or if there are specific settings you are having trouble with, please reply to this ticket, and a human agent from the Rank Math Support team will assist you further.
Thank you for raising this concern!
Sources:
Using Variables in the SEO Title and Description » Rank Math
Using Variables in the SEO Title and Description » Rank MathHi,
I added:
Rankmath Settings > Titles & Meta > Post Types > Products > Single Product Description > %wc_description%
But the product snippet shows up as blank on my products. How do I set the default Snippet for all my Products to pull the data from Product Description, instead of Product Short Description ?
Thanks,
-AnikaHello,
Thank you for contacting Rank Math support.
This is the order we follow to generate meta descriptions for WooCommerce products:
1. Content from the SEO Description field
If that is missing, then:
2. WooCommerce Excerpt or Product Short Description
If that is missing, then:
3. Template From General Settings in WordPress Dashboard > Rank Math > Titles & Meta > Products
If that is missing, then:
4. Auto generated Content from the product page (long description)However, if you want to use the long description (product description) as your meta description then you’ll have to create a custom variable for the product’s long description by adding this filter on your site:
add_action( 'rank_math/vars/register_extra_replacements', function() { rank_math_register_var_replacement( 'woo_full_desc', [ 'name' => esc_html__( 'Woo Full Desc.', 'rank-math' ), 'description' => esc_html__( 'Woo Full Description...', 'rank-math' ), 'variable' => 'woo_full_desc', 'example' => woo_full_desc_callback(), ], 'woo_full_desc_callback' ); } ); function woo_full_desc_callback() { global $post; if ( empty( $post ) ) { return 'Product Description'; } return wp_strip_all_tags( $post->post_content ); }
Here’s how you can add filter/hook to your WordPress site: https://rankmath.com/kb/wordpress-hooks-actions-filters/
After this, you can apply the shortcode globally using the
%woo_full_desc%
variable in the SEO description or single product description field in Rank Math > Titles & Meta > Products.Please note that the filter may not be visible while editing the products as it only works when your products load in a browser. You can check the published/saved product’s meta description via its source code.
The character limit will not apply when you check the source code, however, the limit will be applied in search results.
Let us know how it goes. Looking forward to helping you.
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.
- For the Product Description, you can use the variable
The ticket ‘Change Woocommerce product Snippet’ is closed to new replies.