Single product description & focus keyword issue

#261384
  • Resolved Roman
    Rank Math free

    Hello,

    “Single Product Description” template is not working for product descriptions if products have excerpts.

    I have read various threads related to this bug, and used filter that was suggested by your support staff as a workaround.

    add_filter( 'rank_math/frontend/description', 'my_page_description' );
    function my_page_description( $description ) {
        if ( ! is_woocommerce() ) {
            return $description;
        }
        if ( is_product() ) {
            global $post;
            $custom_description = \RankMath\Post::get_meta( 'description', $post->ID );
            if ( ! $custom_description ) {
                $description_format = \RankMath\Helper::get_settings( 'titles.pt_product_description' );
                if ( $description_format ) {
                    return \RankMath\Helper::replace_vars( $description_format, $post );
                }
            }
        }
        return $description;
    }

    This works for frontend. However, this filter is not applied to SERP preview on product edit page. Rank Math SEO metabox still shows product excerpt as single product description.

    This makes focus keyword tool unusable. I.e. if I have “Buy my product” in filtered description, and don’t have “Buy my product” in product excerpt, focus keyword tool will show incorrect results when tested for “my product” keyword.

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

    Thank you for contacting us and sorry for any inconvenience that might have been caused due to that.

    We understand your concerns but this filter will only run on the frontend and there’s no way to make it run on the backend where you edit your products.

    ​​​​​​​There’s no way to change the behavior of this filter to run everywhere.

    Hope this helps clarify your doubts.

    Don’t hesitate to get in touch if you have any other questions.

    Roman
    Rank Math free

    Hello,

    Thanks for rapid reply.

    Is there any other way to make global single product description template work for both frontend and admin panel when products have excerpts?

    Best Regards

    Hello,

    Unfortunately, at the moment there’s no way to change this behavior.

    We have an internal discussion open in our repository about this situation but so far no final decision is made on whether we’ll change this for future updates or include other options.

    Don’t hesitate to get in touch if you have any other questions.

    Roman
    Rank Math free

    Hello,

    Thanks for information.

    Best Regards

    Ankit
    Rank Math business

    Hello,

    We are glad that we could address your concern. 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.

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

The ticket ‘Single product description & focus keyword issue’ is closed to new replies.