Meta name=”twitter:label1″ “twitter:data1”

#733918
  • Resolved Anonymous
    Rank Math free

    Hi, I use woocommerce on a wordpress installation.
    I found in the product page source these meta tags:

    <meta name=”twitter:label1″ content=”Prezzo” />
    <meta name=”twitter:data1″ content=”€ 132,76″ />

    I would like to disable these meta tags but I dont’found any filter or action useful for this purpose.

    Please, can you show me some hint ?

    Thanks

Viewing 5 replies - 1 through 5 (of 5 total)
  • Hello, we understand your concern about disabling the meta tags related to the product price on your WooCommerce product pages. To achieve this, you can use a filter provided by Rank Math to prevent the output of the price in the OpenGraph tags.

    Here’s the code snippet you can use to remove the product price meta tags:

    /**
     * Allow developers to prevent the output of the price in the OpenGraph tags.
     *
     * @param bool unsigned Defaults to true.
     */
    add_filter( 'rank_math/woocommerce/og_price', '__return_false' );

    You can add this code snippet to your theme’s functions.php file. Once added, it will prevent the product price from being included in the OpenGraph meta tags.

    If you have any further questions or need additional assistance, feel free to ask.

    Sources:
    Rank Math SEO Filters and Hooks for Developers – Rank Math
    How to Make Your Theme Rank Math Compatible » Rank Math
    How to Fix Duplicate Meta Tags » Rank Math
    How to Prevent Modified Date of Your Blog Posts from Being Updated » Rank Math

    Anonymous
    Rank Math free

    Hi, Thank you very musc. I applied the avove code snippet but nothing happens.

    More precisely I already applied the following scripts:

    ————————————-

    add_filter(‘rank_math/json_ld’, function ($data, $jsonld) {
    if (is_product()) {
    if (
    isset($data[‘richSnippet’][‘offers’][‘price’])
    ) {
    unset($data[‘richSnippet’][‘offers’][‘price’]);
    }
    if (
    isset($data[‘richSnippet’][‘offers’][‘lowPrice’])
    ) {
    unset($data[‘richSnippet’][‘offers’][‘lowPrice’]);
    }
    if (
    isset($data[‘richSnippet’][‘offers’][‘highPrice’])
    ) {
    unset($data[‘richSnippet’][‘offers’][‘highPrice’]);
    }
    }
    return $data;
    }, 99, 2);

    add_action( ‘rank_math/head’, function() {
    remove_all_actions( ‘rank_math/opengraph/twitter’ );
    });

    add_filter( ‘rank_math/woocommerce/og_price’, ‘__return_false’, 99);

    ———————————-

    In this way I removed almost all snippets containing price info but still remains the following lines (even applying your suggestion above):

    <meta name=”twitter:label1″ content=”Prezzo” />
    <meta name=”twitter:data1″ content=”€ 132,76″ />
    <meta name=”twitter:label2″ content=”Disponibilità” />
    <meta name=”twitter:data2″ content=”In stock” />

    Hello,

    Thank you for your patience.

    Apologies for the confusion, but the tags like twitter:label and twitter:data are required for Slack sharing integration.

    However, if want to remove them, you can disable the option Slack Enhanced Sharing from WordPress Dashboard > Rank Math > Titles & Meta > Product

    slack

    Hope that helps.

    Anonymous
    Rank Math free

    Hi, that works fine, thank you so much

    Hello,

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

    If you don’t mind me 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 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 ‘Meta name=”twitter:label1″ “twitter:data1”’ is closed to new replies.