Site logo

Archived topic

Schema Markup Best Practice

18 replies · Started by Bobby on October 30, 2020

Viewing posts 1–15 of 19

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

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

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.

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

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?

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.

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

Hi David,

Applied the code.

Now getting itemtype_value 3 ERRORS. Please advise

Link added

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

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.)"

Hi Tom,

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

This archived topic is closed to new replies.