• Resolved kkow

    (@kkow)


    Hi,

    I’m trying to filter out the Person schema and for some reason it’s not working. I am using the following line of code in my functions.php file and nothing changes.

    add_filter( ‘wpseo_schema_person’, ‘__return_false’ );

    However, if I use the following code the ‘webpage’ type is removed as expected:

    add_filter( ‘wpseo_schema_webpage’, ‘__return_false’ );

    Any idea what could be wrong here?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Support Suwash

    (@suascat_wp)

    Hi @kkow,

    You can use the wpseo_schema_graph_pieces filter to add/remove your own schema You can get more filter details here https://developer.yoast.com/features/schema/api/#add-or-remove-graph-pieces.

    I hope that helps.

    I posted simillar question but was wanting to remove datePublished and got a differnt reply from Priscilla Chapman

    “Thanks for the question. We have updated details about the new way of changing the Open Graph metadata using wpseo_frontend_presenter here: https://developer.yoast.com/blog/yoast-seo-14-0-adding-metadata/.

    In the meantime, the wpseo_opengraph action that you may see in examples has been deprecated in 14.0, but full backward-compatibility should be coming in the 14.2 release.

    So, 2 people at Yoast SEO and both different reply. I think people will start switching to rank math soon

    Thread Starter kkow

    (@kkow)

    Thanks Suwash, I must have been looking at the old documentation!

    Thread Starter kkow

    (@kkow)

    For anyone else that may want to remove the “person” schema in the future this is the method that worked for me.

    add_filter( ‘wpseo_schema_author’, ‘__return_false’ );

    Kkow, do you know how to remove published date?

    Tried both

    add_filter( ‘wpseo_schema_datePublished’, ‘__return_false’ );
    add_filter( ‘wpseo_schema_dateModified’, ‘__return_false’ );

    No effect ??

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Person Schema Filter Not Working’ is closed to new replies.