Meta Description is not getting form the value in setting for Product Category.

#25755
  • Resolved Health2Delivery
    Rank Math free

    As in the support forum, I got this code for resolving the meta desc issue, which was getting from product short description.
    Ref- https://support.rankmath.com/ticket/the-short-meta-description-on-the-product/#post-25753

    add_action( ‘rank_math/frontend/description’, function( $description ) {
    if(is_product()){
    global $product;
    $product_details = $product->get_data();
    $product_full_description = $product_details[‘description’];
    //$product_short_description = $product_details[‘short_description’];
    return $product_full_description;
    }
    return $description;
    });

    I added this code in function.php file, The above code works for my site but it makes another issue. Now in the product category desc is getting from the 1st product in the list, not form the product category (I have set in setting).

    Please check the link.

    • This topic was modified 4 years, 10 months ago by Health2Delivery. Reason: Grammar mistake
Viewing 6 replies - 1 through 6 (of 6 total)
  • Hello,

    Thank you for contacting Rank Math today.

    The links provided have different description i.e. Product category desc is different from product desc, from my end. Would you mind sharing screenshots of the issue from your end…

    Looking forward to helping you. Thank you.

    ​​​​​​

    Todd
    Rank Math free

    Hi,

    Please correct me if I am wrong:

    1. Your product category is not showing the correct price?
    https://health2delivery.org/buy-ritalin-online/

    But that is okay since the price variable only works on single products and not on categories.

    2. Instead of using %term%, have you tried using %category%?

    Let me know if that works.

    Hope that helps and please do not hesitate to let us know if you need our assistance with anything else.

    You didn’t get the issue exactly.

    1. The product category desc is not showing what I have set the value in setting, it’s getting from the 1st product des of the list, due to the code which I have added in ‘function.php’ file for resolving the issue of desc (issue – desc was getting from product short desc, not from the value which I had added in setting for product desc).

    2. The values I have set in the Product category in setting that was working fine for product category desc (until the code was not implemented).

    I only want the product category and product desc get and show from the value which I have set in setting for both.

    For Product Category Desc:

    %term% – order brand and generic medicines without prescription with overnight delivery at a discounted price (real and original pills) in the USA.

    For Product Desc:

    Order %title% online without prescription at a discounted price (%wc_price%). %wc_brand% with overnight delivery in the United States.

    I hope I am able to make you understand the issue, and please reply soon because My site desc is not showing what I want to show.

    Hi, Michael Davis

    Thank you for your reply.

    Please check the screenshot I have attached with the link and their description. The product category and Product description are showing the same, But I have set the different.

    image

    image

    image

    I have Removed the code from functions.php and going to install Yoast.

    Hello,

    Thanks for getting back to us and sorry for the inconvenience.

    1). The code that you got from the forum is meant to be used on single products and not product categories and hence the check on the first line if(is_product()).

    2). Before switching to Yoast, we would be happy to check both issues for you and enter the right code if you can share some temporary admin access to your site.
    Please edit the first post on this ticket and include your WP logins in the designated Sensitive Data section.
    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.

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

The ticket ‘Meta Description is not getting form the value in setting for Product Category.’ is closed to new replies.