Archived topic
Remove Microdata markup?
8 replies · Started by 2fer on October 21, 2015
Hi Tom,
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.
Thank you!
2fer
Hi there,
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.
Hi Tom,
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).
Thanks!
2fer
I'll look into this and get back to you :)
Adding the below functions will remove the microdata from the body and article elements: https://gist.github.com/generatepress/539cad38b6bfdc5f9bda
Adding PHP: https://generatepress.com/knowledgebase/adding-php-functions/
In the next version of GP, you'll be able to completely remove the author and date using a simple filter as well :)
Hi Tom,
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!
Thanks again!
2fer
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 :)
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
thank you
Marko
Hi Marko,
You can do so with the code I posted above: https://generatepress.com/forums/topic/remove-microdata-markup/#post-146361
