[Support request] Schema Generator

Home Forums Support [Support request] Schema Generator

Home Forums Support Schema Generator

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1138159
    COINSI SAS

    Hi Guys,

    I was reading about Schema, and I am creating one of them from this page https://technicalseo.com/tools/schema-markup-generator/ I use Yoast Seo to add content to the metadescription box. So, I want to add my own Schema to the front page, so… Can I create the code and paste It into a hook and do not copy anything ? Do I need to disable the GP microdata?

    I am really confused about It.
    I hope you have understood me.

    Thanks !

    #1138535
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    Yes, you can add your own JSON-LD into the wp_head hook.

    If you’re adding your own schema, I do recommend removing the GP schema:

    add_filter( 'generate_schema_type', '__return_false' );

    I would also look at a couple of JSON-LD plugins – they might make it easier on you to tweak things ๐Ÿ™‚

    #1138943
    COINSI SAS

    Hi Tom, Do I really need to remove the GP Schema from the whole theme? So, I just want to add Schema to the front page as your page.

    #1139684
    Tom
    Lead Developer
    Lead Developer

    To remove the built-in schema only on the front page, you can do this:

    add_filter( 'generate_schema_type', function( $type ) {
        if ( ! is_front_page() ) {
            return false;
        }
    
        return $type;
    } );

    Let me know if that helps or not ๐Ÿ™‚

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.