- This topic has 8 replies, 3 voices, and was last updated 4 years, 11 months ago by Tom.
October 21, 2015 at 12:15 am #1461682fer
Is there a simple way to disable or remove the micro-data schema markup? I don’t use it so it throws errors. For some sites, it may be useful, but this site is informational and fairly static, the WP part of this site is only about 10 pages (some legacy pages no-indexed) and the major part of the site is not WP. I may be asking in the wrong place, but I don’t see it in my non-GP WP sites, so I thought I’d ask here first.
2ferOctober 21, 2015 at 12:29 am #146171TomLead DeveloperLead Developer
It shouldn’t throw any errors – there’s not really anything to “use”, it just sits there in the background.
It won’t hurt anything keeping it in there, that’s for sure.
There’s a couple functions to remove some of the main parts, but some other parts are baked into the core theme and not really removable.October 21, 2015 at 12:45 am #1461762fer
Thanks for the quick response. Your support is great! The microdata/schema is lacking information. It wants the “Author” and “Date”, I have not set it up to use this information (and won’t). I can’t see what it does add so I would prefer to remove or disable it if possible. I very much enjoy using the Generate Press theme, but schema should be an individual decision. BTW – the only “Errors” reported are in the GSC (WMT).
2ferOctober 21, 2015 at 12:59 am #146178TomLead DeveloperLead DeveloperOctober 21, 2015 at 4:25 pm #146361TomLead DeveloperLead Developer
Adding the below functions will remove the microdata from the body and article elements: https://gist.github.com/generatepress/539cad38b6bfdc5f9bda
In the next version of GP, you’ll be able to completely remove the author and date using a simple filter as well 🙂October 21, 2015 at 7:33 pm #1463742fer
Thank you so much for this solution! I’ll keep a backup copy of functions.php before editing and just upload the edited file. I’m more comfortable editing the php than using another plugin for this. I certainly appreciate the quick answer and think you’re doing a super job!
2ferOctober 21, 2015 at 11:47 pm #146415TomLead DeveloperLead Developer
It’s definitely best just to use a child theme functions.php file – then you can just add the PHP to that file and forget about it 🙂January 4, 2016 at 4:41 am #163237Marko
Hello Tom. Happy new Year! You wrote in the past that the microdata could be removed with a simple filter. Is it be possible with the current Theme version 1.3.23? I use the child theme 0.1
MarkoJanuary 4, 2016 at 10:38 am #163306TomLead DeveloperLead Developer
You can do so with the code I posted above: https://generatepress.com/forums/topic/remove-microdata-markup/#post-146361
- You must be logged in to reply to this topic.