Site logo

Archived topic

Schema Generator

3 replies · Started by COINSI SAS on January 20, 2020

Viewing posts 1–4 of 4

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 !

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 :)

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.

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 :)

This archived topic is closed to new replies.