• Hello,

    I used this plugin to add some missing schema structured data to my webpages. The problem is that the strings I enter in the code editor changes in front end. For example I added the following code:
    $schema[‘review’] = array(
    “@type” => “test”

    But I get “?est” in frontend instead of “test”. I checked the database and found out the string is stored correctly in database. Is there something wrong with the plugin or my website is causing this issue?

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Shea Bunge

    (@bungeshea)

    I’d probably need to see more of the snippet to have an idea of what might be going wrong.

    Thread Starter vahiditor

    (@vahiditor)

    the code snippet is like below:

    add_filter( ‘wpseo_schema_needs_review’, ‘__return_false’);
    add_filter(‘woocommerce_structured_data_product’, function($schema, $product) {
    $schema[‘gtin13’] = ‘NULL’;
    $schema[‘aggregateRating’] = array(
    ‘bestRating’ => ‘5’,
    ‘worstRating’ => ‘1’,
    );
    $schema[‘review’] = array(
    ‘@type’ => ‘test’,
    ‘author’ => array(
    ‘@type’ => “Person”,
    ‘name’ => ‘mr karimi’,
    ),
    ‘reviewBody’ => ‘good quality procuct’,
    );
    return $schema;
    }, 10, 2);
    add_filter( ‘schema_wp_output_category_enabled’, ‘__return_false’ );

    Plugin Author Shea Bunge

    (@bungeshea)

    You can’t use @type twice in the same array – array keys need to be unique. There can only be one type for each schema block.

    Thread Starter vahiditor

    (@vahiditor)

    There is another array nested in the mother array. I don’t see any problem with nested arrays.

    Plugin Author Shea Bunge

    (@bungeshea)

    My apologies – it’s a little tricky to see without the indentation.

    Would it be possible to clarify what you mean by “in the front end”? Are you somehow displaying the code on your site? Or do you mean in the code editor after saving it looks like that?

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘problem with strings’ is closed to new replies.