Site logo

[Support request] remove schema created by theme

Home Forums Support [Support request] remove schema created by theme

Home Forums Support remove schema created by theme

Viewing 15 posts - 1 through 15 (of 32 total)
  • Author
    Posts
  • #729818
    dassana

    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.

    #729979
    Tom
    Lead Developer
    Lead Developer

    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 '';
    } );
    #730055
    dassana

    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.

    #730384
    Tom
    Lead Developer
    Lead Developer

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

    #730646
    dassana

    the new theme is active on the entire site. some pages are cached and some are not. i have purged the cache of a post and you can check on this link – https://www.vegrecipesofindia.com/bhindi-masala

    #731132
    Tom
    Lead Developer
    Lead Developer

    Now I’m seeing the new version.

    Where did you add the function above?

    #731159
    dassana

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

    #731395
    Tom
    Lead Developer
    Lead Developer

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

    #731711
    dassana

    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.

    #732366
    Tom
    Lead Developer
    Lead Developer

    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' );

    #732958
    Dietmar

    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!

    #732977
    dassana

    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’ );

    #733570
    Tom
    Lead Developer
    Lead Developer

    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.

    #734072
    dassana

    hi tom

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

    #734374
    dassana
Viewing 15 posts - 1 through 15 (of 32 total)
  • You must be logged in to reply to this topic.