Site logo

Archived topic

remove schema created by theme

31 replies · Started by dassana on November 17, 2018

Viewing posts 1–15 of 32

hi

i want to remove the schema created by generatepress theme. basically i just want the recipe schema and not the other schema. is there a way i can remove the other schema types like hcard, comment, wpsidebar, creative work, navigation element, person and hatom.

Hi there,

You'd have to install 2.2, which is currently a release candidate: https://generatepress.com/generatepress-2-2/

Then you can add this function:

add_filter( 'generate_schema_type', function() {
    return '';
} );

thanks tom. i have upgraded generatepress to 2.2. i am using a child theme so added the code in the child theme's functions.php file. but i am not seeing any changes.

as you have mentioned in a previous thread, that the schema can be turned off in the customizer, i cannot see any such option in the customizer. i also checked a few links in google structured data tool, but cannot see any changes.

I'm still seeing 2.1.4 on your website. Are all caching plugins cleared?

Now I'm seeing the new version.

Where did you add the function above?

i have added the code in the child theme’s functions.php file.

Have you made sure all caches are clear? Testing on my end and it's all working as it should with that exact code.

yes i did for the link i gave. but i can see the extra schema on the structured data tool. also i cannot see any option in the customizer for disabling the extra schema. i can see the other changes you have included in the customizer option.

i hope i am following the right thing. i do not know how the extra schema can be removed. for now the code is still added in the functions.php child theme.

There is no Customizer option to disable the microdata - you need to use the function.

I just gave this to another customer and it worked:

add_filter( 'generate_schema_type', '__return_false' );

Hi there,

I tried both codes mentioned above and I'm still seeing the hatom microformat on both my pages in Googles testing tool.

Basically I only want the Article type schema. Can you help me with that?

Thank you!

hi tom

not sure why the extra schema is appearing in the google testing tool. i have added both the codes that you have given at separate times. no change in the schema. it's the same. intitally i added the first code and then removed it and added the second code. for now the second code is active on the site and you can check this link - https://www.vegrecipesofindia.com/matar-paneer/

first code:
add_filter( 'generate_schema_type', function() {
return '';
} );

second code:
add_filter( 'generate_schema_type', '__return_false' );

Dietmar - the hatom stuff is done using classes within the elements. These classes can't be removed currently. However, having them in there won't interfere with your schema microdata at all.

dassana - I'm not seeing the built-in microdata on your site anymore.

hi tom

i did not understand what you mean? in the google testing tool i can see the extra schema with no changes.

This archived topic is closed to new replies.