Prevent the generation of Twitter tags (meta)

#770625
  • Resolved Klaus
    Rank Math free

    Dear support,

    how can I prevent the generation of Twitter tags (meta) with the current version of RankMath? This suggestion is not a valid solution:

    /**
    * Function to disable SEO Tags generated by Rank Math
    */
    function rankmath_disable_features() {
    if ( is_singular( ‘page’ ) ) {
    remove_all_actions( ‘rank_math/head’ );
    }
    }
    add_action( ‘wp_head’, ‘rankmath_disable_features’, 1 );

    Thank you very much, Klaus.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Hello, I apologize for the inconvenience you are facing with Rank Math generating Twitter meta tags. To stop Rank Math from generating Twitter tags in the current version, you can follow these steps:

    1. Navigate to WordPress DashboardAppearance → Theme File Editor.

    2. Add the following code snippet to your theme’s functions.php or rank-math.php file:

    /**
     * Function to disable SEO Tags generated by Rank Math
     */
    function rankmath_disable_features() {
        if ( is_singular( 'page' ) ) {
            remove_all_actions( 'rank_math/head' );
        }
    }
    add_action( 'wp_head', 'rankmath_disable_features', 1 );
    1. Click the Update File button to save the changes. This code will remove the SEO tags generated by Rank Math on all pages.

    If you need further assistance or have any other questions, feel free to ask. Thank you for reaching out!

    Sources:
    How to Disable All Rank Math Generated SEO Tags » Rank Math
    Fix Excluded by NoIndex Tag – Google Search Console Status » Rank Math
    Sorry, You Are Not Allowed to Access This Page » Rank Math

    Klaus
    Rank Math free

    Thank you very much. I assume that the generation of Twitter tags cannot be explicitly prevented but only all tags.

    BR, KLaus.

    Hello,

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

    Kindly disregard the filter shared by the bot earlier.

    If you want to remove all the Twitter meta tags from your website then you can try to add the following filter on your site:

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

    Here’s how you can add filter/hook to your WordPress site: https://rankmath.com/kb/wordpress-hooks-actions-filters/

    Hope that helps and please don’t hesitate to let us know if you have any other questions.
     
    Thank you.

    Klaus
    Rank Math free

    Hi Adetayo,

    thank you very much again.

    BR, Klaus.

    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 WordPress or TrustPilot 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 ‘Prevent the generation of Twitter tags (meta)’ is closed to new replies.