• Resolved onfix

    (@bharat52)


    Hi,

    in this Article, I Change Article Schema output to Game

    https://developer.yoast.com/features/schema/pieces/article/#api

    and add the following code in themes functions.php

    add_filter( 'wpseo_schema_article', 'change_article_to_game' );
    
    function change_article_to_game( $data ) {
        $data['@type'] = 'Game';
    
        return $data;
    }

    But not changed output anyting, what happens?

    what i need to change the code anything?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support Maybellyne

    (@maybellyne)

    Hello @bharat52,

    Thanks for reaching out about your site schema. Though the Yoast SEO plugin does not add the game schema type, you can indeed extend the plugin. However, I cannot review your schema implementation on your site. You may consider getting a web developer to help with this.

    Thread Starter onfix

    (@bharat52)

    thanks,

    okay

    I want remove completely <meta property=”og:type” content=”article” /> following these code, but still not removed the meta tag.

    function remove_ogtype_presenter( $presenters ) {
        return array_map( function( $presenter ) {
            if ( ! $presenter instanceof Type_Presenter ) {
                return $presenter;
            }
        }, $presenters );
    }
    
    add_action( 'wpseo_frontend_presenters', 'remove_ogtype_presenter' );

    any solution?

    Plugin Support Michael Ti?a

    (@mikes41720)

    Hi @bharat52

    You can refer to our Metadata API if you want to remove or modify some of the open graph presenters such as the og:type tag – https://developer.yoast.com/customization/apis/metadata-api/#opengraph-presenters

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Change Article Schema output to Game’ is closed to new replies.