• Resolved ivanisevic82

    (@ivanisevic82)


    On my website, I want to implement custom schema markup for each page.

    I’ve tried doing this by customizing Yoast’s native function through the addition of “graph pieces”, but every time I use this function in the functions.php file, I receive a fatal error and have to restore the functions file manually.

    add_filter( 'wpseo_schema_graph_pieces', 'add_custom_schema_piece', 11, 2 );

    So, I’ve prepared custom and independent schemas from Yoast, which give me more flexibility and less dependency.

    However, on some pages, the presence of two schemas might seem redundant.

    I would like to know from you:

    1. If you have any information or advice for the fatal error I receive every time I use add_filter( 'wpseo_schema_graph_pieces', 'add_custom_schema_piece', 11, 2 );
    2. If I want to use custom schemas, whether the coexistence with Yoast’s schemas is or can be harmful.
    3. If it’s possible to selectively disable Yoast’s schemas, only for some pages (I am speaking only about schemas, not breadcrumbs).

    Thank you for the support!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support Maybellyne

    (@maybellyne)

    Hello @ivanisevic82,

    Thanks for using the Yoast SEO and I’ve addressed your concerns below:

    If you have any information or advice for the fatal error I receive

    We’re unable to review your implementation to troubleshoot the fatal error.

    If I want to use custom schemas, whether the coexistence with Yoast’s schemas is or can be harmful.

    It’s not harmful to have the Yoast SEO schema output and custom schema output; so far, there are no duplicates.

    If it’s possible to selectively disable Yoast’s schemas, only for some pages (I am speaking only about schemas, not breadcrumbs).

    That’s possible. Please review our Schema – API documentation

    Thread Starter ivanisevic82

    (@ivanisevic82)

    Hello Maybellyne, thank you for the support. Regarding the last issue, I went through the documentation you linked, but I didn’t find specific instructions for removing the sitelink search box, only the breadcrumbs. Contrarily, I would like to keep the breadcrumbs but remove the text search box to use my custom one. Do you think a code like this would work?

    Thank you again!

    add_filter( ‘wpseo_schema_website’, ‘remove_searchaction_from_website_schema’ );

    function remove_searchaction_from_website_schema( $data ) {
    if (isset($data[‘potentialAction’])) {
    unset($data[‘potentialAction’]);
    }
    return $data;
    }

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Coexistence of Custom Schema Markup and Yoast Schemas’ is closed to new replies.