How to disable schema.org markup

Posted in: Newspaper
Post count: 4

Hi,
we are using wprichsnippets to create reviews and ratings for videos.
Using wprichsnippets together with the built-in schema.org markup from the newspaper theme gives duplicate markup on posts.

See https://search.google.com/structured-data/testing-tool/u/0/?hl=de#url=https%3A%2F%2Fwww.kleinkunst.theater%2Ffueenf-komm-ins-bett-making-of%2F

How can we disable scham.org markup from the theme?
(some themes have a switch in general settings to do this.)

Tx,
Frank

Post count: 22421

Hi Frank,
Unfortunately our theme does not have a switch to remove the markup. It will have to be removed from the theme files. Pleas provide more details to what markup you are referring to as I cannot see any double markup in the example you showed.
Thank you!

Post count: 4

e.g. the author item is part of Blog-posting as type ‘thing’ and within Article as type ‘Person’ and again within hentry as type ‘hcard’. And the Article item (coming from Newspaper-them) should not be there at all, when there is the Blog-Posting (coming from wprichsnippets) item.

Which theme files would have to be modified?

A first grep gives header.php and td_module_single_base.php as the only sources which mention schema.org?!

Tx, Frank

Post count: 22421

Hi,
There is no duplication as the elements you describe are very different from one another. Please check this post to see that this duplication is normal as long as it;s in different sections. hentry is not equal to article and is not equal to blog-posting. https://forum.tagdiv.com/topic/the-content-of-hentry-diagram-may-be-double/
Here are the places you need to search for schema information if you want to remove it: http://screencast.com/t/dBo5DxfcfQ6N
I hope this helps.
Thank you!

Post count: 4

Hi Bogdan,

this is very useful info. Thank you!

I checked with the author of wprichsnippets and he pointed out:

“I can see schema for Article and BlogPosting, these two could conflict. It’s not harmful though, the thing here is Google will pick one of them, I don’t know which.”

What is your view on that?

Regards,
Frank

Post count: 22421

Hello,
Unfortunately I cannot say for sure either if google will conflict with both these entries but if you really want to remove the theme article schema you can simply comment out this part of the function:
http://screencast.com/t/jAsS6hlgEXr
I hope this helps.
Thank you!

Post count: 4

Excellent. Good to learn.

Final question:
when changing this in the parent-theme files it is not update safe.

Can I overwrite that function in my child-theme functions.php?


if ( ! function_exists( 'get_item_scope' ) ) :
function get_item_scope() {
//show the review meta only on single posts that are reviews, the rest have to be article (in article lists)
// if ($this->is_review && is_single()) {
// return 'itemscope itemtype="' . td_global::$http_or_https . '://schema.org/Review"';
// } else {
// return 'itemscope itemtype="' . td_global::$http_or_https . '://schema.org/Article"';
}

Post count: 22421

Hi,

If you want to change a function from functions.php then it gets a bit more complicated as the functions.sphp will not re-write the function in the main theme. You will have to set priorities for them. Maybe this guide will help you understand better how this works: http://code.tutsplus.com/tutorials/a-guide-to-overriding-parent-theme-functions-in-your-child-theme–cms-22623

Thank you!

Post count: 76

Hi, i have same problem, how to comment?

function get_item_scope() {
//show the review meta only on single posts that are reviews, the rest have to be article (in article lists)
if ($this->is_review && is_single()) {
return 'itemscope itemtype="' . td_global::$http_or_https . '://schema.org/Review"';
} else {
return 'itemscope itemtype="' . td_global::$http_or_https . '://schema.org/Article"';
}
}

Post count: 76

Ok, sorry,it’s work without :
if ( ! function_exists( 'get_item_scope' ) ) :

function get_item_scope() {
//show the review meta only on single posts that are reviews, the rest have to be article (in article lists)
// if ($this->is_review && is_single()) {
// return 'itemscope itemtype="' . td_global::$http_or_https . '://schema.org/Review"';
// } else {
// return 'itemscope itemtype="' . td_global::$http_or_https . '://schema.org/Article"';
}

Viewing 10 posts - 1 through 10 (of 10 total)
The forum ‘Newspaper’ is closed to new topics and replies.