[Resolved] Remove Microdata markup?

Home Forums Support [Resolved] Remove Microdata markup?

Home Forums Support Remove Microdata markup?

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #146168
    2fer

    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

    #146171
    Tom
    Lead Developer
    Lead Developer

    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.

    #146176
    2fer

    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

    #146178
    Tom
    Lead Developer
    Lead Developer

    I’ll look into this and get back to you πŸ™‚

    #146361
    Tom
    Lead Developer
    Lead Developer

    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 πŸ™‚

    #146374
    2fer

    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

    #146415
    Tom
    Lead Developer
    Lead 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 πŸ™‚

    #163237
    Marko

    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

    #163306
    Tom
    Lead Developer
    Lead Developer

    Hi Marko,

    You can do so with the code I posted above: https://generatepress.com/forums/topic/remove-microdata-markup/#post-146361

Viewing 9 posts - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.