[Support request] Schema Markup Best Practice

Home Forums Support [Support request] Schema Markup Best Practice

Home Forums Support Schema Markup Best Practice

Viewing 15 posts - 1 through 15 (of 19 total)
  • Author
    Posts
  • #1511759
    Bobby

    Hi Team,

    We are using Yoast plugin, I understand yoast also adds schema markup

    So do we need to disable GP default schema markup (CreativeWork)? Can we use both

    Can you suggest few free tools to test schema markup

    #1511844
    Leo
    Staff
    Customer Support

    Hi there,

    Our usual recommendation is that if you are adding your own schema, then it’s likely a good idea to disable the GP’s default schema:
    https://docs.generatepress.com/article/generate_schema_type/
    https://docs.generatepress.com/article/generate_is_using_hatom/

    I don’t have a specific recommendation for this. If you google “schema markup testing tool” then there should be quite a few options out there.

    Let me know if this helps 🙂

    #1517059
    Bobby

    Hi Leo,

    Thanks for that.

    Disabled the GP’s default schema. When checked through google structured markup testing tool it still shows CreativeWork. Please advise

    #1517077
    Leo
    Staff
    Customer Support

    So you’ve added filter code here?
    https://docs.generatepress.com/article/generate_schema_type/

    How are you adding it? Any caching plugins?

    Are you sure it’s still coming from GP?

    We’ve provided the solution numerous times and it should definitely work 🙂

    #1517177
    Bobby

    Installed GP in our stage server and testing. Send you link privately

    Added above code in function.php file.
    No cache issues I could think of.

    #1517223
    Philipp

    I adding the php filter code by using a hook element in wp_head.

    “creative work” is still showing up.

    am I doing it wrong?

    thank you

    #1517336
    David
    Staff
    Customer Support

    Hi Phillip,

    this article explains how to add PHP Snippets such as the add_filter

    https://docs.generatepress.com/article/adding-php/

    #1517404
    Philipp

    Thank you. I am aware of the adding-php article – and was hoping that I wouldnt have to install another plugin/childtheme just for this feature.

    most php needs I could integrate using GP elements just fine – I guess in this case it doesnt work?

    #1517463
    David
    Staff
    Customer Support

    Changes to core functions such as using the add_filter hook has to be applied before the templates are output. Whereas the Hook Element ( add_action ) is applying that code directly into the two.

    Child Themes are generally the best way to go. If not the Code Snippets plugin is the next best bet.

    #1517479
    David
    Staff
    Customer Support

    Hi Bobby,

    the schema is coming from the WP Show Post plugin.
    Unfortunately the itemtype is baked into the code. But you can filter its value:

    add_filter( 'wpsp_defaults', function( $defaults ) {
    
        $defaults['wpsp_itemtype']	= 'itemtype_value';
        return $defaults;
    
    }, 20 );
    #1518599
    Bobby

    Hi David,

    Applied the code.

    Now getting itemtype_value 3 ERRORS. Please advise

    Link added

    #1518670
    David
    Staff
    Customer Support

    As i said you cannot remove the schema but you can change its itemtype.
    This line of the code:

    $defaults['wpsp_itemtype'] = 'itemtype_value';

    change the itemtype_value to whatever alternative itemtype you want instead of the default CreativeWork

    For example itemtype of Article

    #1520262
    Bobby

    Hi David,

    Tried added below code

    add_filter( ‘wpsp_defaults’, function( $defaults ) {

    $defaults[‘wpsp_itemtype’] = ‘relatedLink’;
    return $defaults;

    }, 20 );

    Because it’s coming from relatedposts

    https://schema.org/relatedLink

    Google structure markup tool gives error ”
    relatedLink (The type relatedLink is not a type known to Google.)”

    #1521038
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    Our current development version has an option to turn off microdata: https://wpshowposts.com/wp-show-posts-1-2-0/

    #1521138
    Bobby

    Hi Tom,

    Excellent. When are you expecting to release 1.2.0 prod version ?

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