• Resolved Jairo Ochoa

    (@jairoochoa)


    Hi,

    Is there any snippet to add to my functions.php son it would disable all social media meta-tag ?
    I do not want that some pages contain these meta-tags.

    <meta property="og:locale" content="es_ES" />
    <meta property="og:type" content="object" />
    <meta property="og:title" content="Page title" />
    <meta property="og:site_name" content="Website name" />
    <meta name="twitter:card" content="summary_large_image" />
    <meta name="twitter:title" content="Page title" />
    <meta name="twitter:image" content="image.png" />

    Thanks

Viewing 1 replies (of 1 total)
  • Thread Starter Jairo Ochoa

    (@jairoochoa)

    Hi,

    I answer myself:

    remove_action( 'wpseo_head', array( $GLOBALS['wpseo_og'], 'opengraph' ), 30 );
    remove_action( 'wpseo_head', array( WPSEO_Twitter , 'get_instance' ) , 40 );
    add_filter( 'wpseo_locale', '__return_false' ); // for some reason does not remove, it sets to "en_US"
    add_filter( 'wpseo_opengraph_url' , '__return_false' );
    add_filter( 'wpseo_opengraph_desc', '__return_false' );
    add_filter( 'wpseo_opengraph_title', '__return_false' );
    add_filter( 'wpseo_opengraph_type', '__return_false' );
    add_filter( 'wpseo_opengraph_site_name', '__return_false' );
    add_filter( 'wpseo_opengraph_image' , '__return_false' );
    add_action( 'wpseo_add_opengraph_images', '__return_false' );
    add_filter( 'wpseo_twitter_title' , '__return_false' );
    add_filter( 'wpseo_twitter_description' , '__return_false' );
    add_filter( 'wpseo_twitter_image' , '__return_false' );
    

    Thanks

    • This reply was modified 7 years, 8 months ago by Jairo Ochoa.
    • This reply was modified 7 years, 8 months ago by Jairo Ochoa.
Viewing 1 replies (of 1 total)

The topic ‘Disable og and twitter meta-tags for some page’ is closed to new replies.