Archived topic
Remove CreativeWorks Schema
9 replies · Started by Earl on April 15, 2021
Hello,
Currently, when I run it in Google’s data structure tool, I get the below schema.
Can you let me know how to remove it?
I added my website / schema I am in dealing with in sensitive data.
Hi there,
you can disable all the of the GP Schema using this PHP Snippet:
add_filter( 'generate_schema_type', '__return_false' );
Adding PHP: https://docs.generatepress.com/article/adding-php/
Or you can try this snippet to remove just the article schema type
add_filter( 'generate_article_microdata', '__return_empty_string' );
Is there a way to do this without a plug-in?
You will need to install a Child Theme if you don't want to use the Code Snippets plugin:
https://docs.generatepress.com/article/using-child-theme/
And then add the code to your Child Themes functions.php
Hmmm - I added the snippet using Code Snippets. But I am still getting the same schema popping up.
Can you confirm if GP adds the "CreativeWork" schema somehow? If so - I would know the problem is GP and not something else. If it is not GP, how can I tell what is causing it?
Yes - GP adds the creativeWorks type to its article HTML.
And that code has worked as i cannot see that attribute anymore.
But you have this JSON-LD added to the Header Element:
{
"@context": "https://schema.org/",
"@type": "CreativeWorkSeries",
"name": "Law Firm of Earl P. White",
"aggregateRating": {
"@type": "AggregateRating",
"ratingValue": "5",
"bestRating": "5",
"ratingCount": "39"
}
}
Thats not coming from GP - its either been added manually to the Header Element or another plugin is generating it.
Ok - yes - I was intended to add that and did not want it to conflict with any other schema related to creativework.
What tool did you see to confirm it was removed? Strucutred data tool was still showing it.
Hi there,
What tool did you see to confirm it was removed? Strucutred data tool was still showing it.
Chrome devtools. That comes out of the box w/ Google Chrome Browser.
You simply right-click the page in click Inspect, Or use shortcut keys. https://developer.chrome.com/docs/devtools/shortcuts/
Thank you. The above method worked using Code Snippets and my stars are now showing.
No problem. Glad you got it sorted. :)