Title: schema markup error
Last modified: May 8, 2019

---

# schema markup error

 *  [Endless Hair Extensions](https://wordpress.org/support/users/endlesshairextensions/)
 * (@endlesshairextensions)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/schema-markup-error-2/)
 * HI, I’m having an issue with my site’s structured data markup. when I tried to
   add the structured data as JSON-LD markup to Generatepress’s theme editor, I 
   get this error:
 * Something went wrong. Your change may not have been saved. Please try again. 
   There is also a chance that you may need to manually fix and upload the file 
   over FTP.
 * tried to add this JSON-LD markup:
 * <!– JSON-LD markup generated by Google Structured Data Markup Helper. –>
    <script
   type=”application/ld+json”> { “@context” : “[http://schema.org&#8221](http://schema.org&#8221);,“
   @type” : “Product”, “image” : “[https://www.endlesshairextensions.com/wp-content/uploads/2019/01/shutterstock_120599233-Copy-2-Copy-1024×817.jpg&#8221](https://www.endlesshairextensions.com/wp-content/uploads/2019/01/shutterstock_120599233-Copy-2-Copy-1024×817.jpg&#8221);,“
   description” : “Buy human hair from our extensive Brazilian Hair, virgin hair&
   Remy Hair collections and get thicker and fuller hair to achieve those voluminous
   hair dreams!”, “brand” : { “@type” : “Brand”, “logo” : “[https://www.endlesshairextensions.com/wp-content/uploads/2019/01/Endless-Hair-Logo-Trans-Cropped_2_410x-1-1.png&#8221](https://www.endlesshairextensions.com/wp-content/uploads/2019/01/Endless-Hair-Logo-Trans-Cropped_2_410x-1-1.png&#8221);},“
   offers” : { “@type” : “Offer”, “price” : “59.99” } } </script>
 * Can you help?
    Jen
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fschema-markup-error-2%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 15 replies - 1 through 15 (of 23 total)

1 [2](https://wordpress.org/support/topic/schema-markup-error-2/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/schema-markup-error-2/page/2/?output_format=md)

 *  Theme Author [Tom](https://wordpress.org/support/users/edge22/)
 * (@edge22)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/schema-markup-error-2/#post-11511327)
 * Hi there,
 * Where are you trying to add that code?
 * The files in the theme editor are PHP, so you can’t add non-PHP into them easily
   without opening and closing PHP tags.
 * You can try this code instead:
 *     ```
       add_action( 'wp_footer', function() {
           ?>
               Your code in here
           <?php
       } );
       ```
   
 * Then add the code using one of these methods instead of editing the core theme
   files: [https://docs.generatepress.com/article/adding-php/](https://docs.generatepress.com/article/adding-php/)
 *  Thread Starter [Endless Hair Extensions](https://wordpress.org/support/users/endlesshairextensions/)
 * (@endlesshairextensions)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/schema-markup-error-2/#post-11512939)
 * HI, and thank you so much for your reply. I did as you suggested but got this
   message:
 * Don’t Panic
    The code snippet you are trying to save produced a fatal error on
   line 1:
 * syntax error, unexpected ‘&’
    The previous version of the snippet is unchanged,
   and the rest of this site should be functioning normally as before.
 * Please use the back button in your browser to return to the previous page and
   try to fix the code error. If you prefer, you can close this page and discard
   the changes you just made. No changes will be made to this site.
 * This is what I attempted to add:
 * add_action( 'wp_footer', function() {
    ?> <!– JSON-LD markup generated by Google
   Structured Data Markup Helper. –> <script type=”application/ld+json”> { “@context”:“
   [http://schema.org&#8221](http://schema.org&#8221);, “@type” : “Product”, “image”:“
   [https://www.endlesshairextensions.com/wp-content/uploads/2019/01/shutterstock_120599233-Copy-2-Copy-1024×817.jpg&#8221](https://www.endlesshairextensions.com/wp-content/uploads/2019/01/shutterstock_120599233-Copy-2-Copy-1024×817.jpg&#8221);,“
   description” : “Buy human hair from our extensive Brazilian Hair, virgin hair&
   Remy Hair collections and get thicker and fuller hair to achieve those voluminous
   hair dreams!”, “brand” : { “@type” : “Brand”, “logo” : “[https://www.endlesshairextensions.com/wp-content/uploads/2019/01/Endless-Hair-Logo-Trans-Cropped_2_410x-1-1.png&#8221](https://www.endlesshairextensions.com/wp-content/uploads/2019/01/Endless-Hair-Logo-Trans-Cropped_2_410x-1-1.png&#8221);},“
   offers” : { “@type” : “Offer”, “price” : “59.99” } } </script> <?php } );
 *  Thread Starter [Endless Hair Extensions](https://wordpress.org/support/users/endlesshairextensions/)
 * (@endlesshairextensions)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/schema-markup-error-2/#post-11513494)
 * Also, you asked before where I was adding the code, in the header theme editor.
   Is this the correct place? I’m trying to add structured data markup using Google
   recommended JSON-LD.
    Still trying to understand why I can’t.
 * Jen
    -  This reply was modified 7 years, 1 month ago by [Endless Hair Extensions](https://wordpress.org/support/users/endlesshairextensions/).
 *  Theme Author [Tom](https://wordpress.org/support/users/edge22/)
 * (@edge22)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/schema-markup-error-2/#post-11515381)
 * Instead of adding it in the theme editor, can you try one of these methods?: 
   [https://docs.generatepress.com/article/adding-php/](https://docs.generatepress.com/article/adding-php/)
 *  Thread Starter [Endless Hair Extensions](https://wordpress.org/support/users/endlesshairextensions/)
 * (@endlesshairextensions)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/schema-markup-error-2/#post-11517903)
 * Hi, ok so I can make a plugin and add your
    functions (your code you suggested
   I use) to the plugin file?
 *  Theme Author [Tom](https://wordpress.org/support/users/edge22/)
 * (@edge22)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/schema-markup-error-2/#post-11519570)
 * It’s likely easier to use a plugin like this: [https://wordpress.org/plugins/code-snippets/](https://wordpress.org/plugins/code-snippets/)
 *  Thread Starter [Endless Hair Extensions](https://wordpress.org/support/users/endlesshairextensions/)
 * (@endlesshairextensions)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/schema-markup-error-2/#post-11520877)
 * I did use this plugin but it was not effective and I got this message instead:
 * Don’t Panic
    The code snippet you are trying to save produced a fatal error on
   line 1:
 * syntax error, unexpected ‘&’
    The previous version of the snippet is unchanged,
   and the rest of this site should be functioning normally as before.
 * Please use the back button in your browser to return to the previous page and
   try to fix the code error. If you prefer, you can close this page and discard
   the changes you just made. No changes will be made to this site.
 * This is what I attempted to add:
 * add_action( ‘wp_footer’, function() {
    ?> <!– JSON-LD markup generated by Google
   Structured Data Markup Helper. –> <script type=”application/ld+json”> { “@context”:“
   http://schema.org”, “@type” : “Product”, “image” : “https://www.endlesshairextensions.
   com/wp-content/uploads/2019/01/shutterstock_120599233-Copy-2-Copy-1024×817.jpg”,“
   description” : “Buy human hair from our extensive Brazilian Hair, virgin hair&
   Remy Hair collections and get thicker and fuller hair to achieve those voluminous
   hair dreams!”, “brand” : { “@type” : “Brand”, “logo” : “https://www.endlesshairextensions.
   com/wp-content/uploads/2019/01/Endless-Hair-Logo-Trans-Cropped_2_410x-1-1.png”},“
   offers” : { “@type” : “Offer”, “price” : “59.99” } } </script> <?php } );
 *  Thread Starter [Endless Hair Extensions](https://wordpress.org/support/users/endlesshairextensions/)
 * (@endlesshairextensions)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/schema-markup-error-2/#post-11521515)
 * I tried adding your code again and it did not give me an error, which is great.
   How do I know that it works? When I run the Google structured test tool, the 
   same error shows that prompted me to try to add the code to the themes editor
   originally so I’m not sure that I have been able to resolve the original issue
   in the end.
 * Seems Elementor does not support schema markup yet so there is an error that 
   Google shows and prevents the markup. I was hoping that adding the code directly
   to the themes editor would be a workaround.
 * Thoughts?
    And thank you for your help!
 *  Theme Author [Tom](https://wordpress.org/support/users/edge22/)
 * (@edge22)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/schema-markup-error-2/#post-11521537)
 * What’s the error you’re getting that’s prompting you to add that code?
 *  Thread Starter [Endless Hair Extensions](https://wordpress.org/support/users/endlesshairextensions/)
 * (@endlesshairextensions)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/schema-markup-error-2/#post-11521561)
 * This is a screenshot of the error from the Google Structured Data Tool:
 * [https://snag.gy/52MalH.jpg](https://snag.gy/52MalH.jpg)
 * What do you think??
 *  Thread Starter [Endless Hair Extensions](https://wordpress.org/support/users/endlesshairextensions/)
 * (@endlesshairextensions)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/schema-markup-error-2/#post-11521566)
 * sorry, meant to include this one as well:
 * [https://snag.gy/Qbm9P1.jpg](https://snag.gy/Qbm9P1.jpg)
 *  Theme Author [Tom](https://wordpress.org/support/users/edge22/)
 * (@edge22)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/schema-markup-error-2/#post-11522798)
 * Can you take a screenshot of the actual warning? It looks like it’s further down
   the page.
 * Let me know 🙂
 *  Thread Starter [Endless Hair Extensions](https://wordpress.org/support/users/endlesshairextensions/)
 * (@endlesshairextensions)
 * [7 years ago](https://wordpress.org/support/topic/schema-markup-error-2/#post-11523322)
 * HI, here is a screenshot of the actual warning.
 * [https://snag.gy/JBG2rz.jpg](https://snag.gy/JBG2rz.jpg)
 *  Theme Author [Tom](https://wordpress.org/support/users/edge22/)
 * (@edge22)
 * [7 years ago](https://wordpress.org/support/topic/schema-markup-error-2/#post-11527689)
 * So this is happening because GeneratePress uses the CreativeWork name to be as
   compatible as possible with all content.
 * Something in your content is using reviewRating, which isn’t compatible with 
   CreativeWork.
 * The part of your content that is using reviewRating should have a container which
   sets the itemtype as something that’s compatible with reviewRating.
 * You could make it so GP doesn’t use CreativeWork and uses something compatible
   with reviewRating, but doing this will likely cause more errors, as your content
   will be missing other required things.
 * How are you adding the element that’s set as a reviewRating?
 *  Thread Starter [Endless Hair Extensions](https://wordpress.org/support/users/endlesshairextensions/)
 * (@endlesshairextensions)
 * [7 years ago](https://wordpress.org/support/topic/schema-markup-error-2/#post-11527742)
 * Elementor Technical Support told me that I had to remove the Star Rating widget.
   but this would remove the website reviews. The error you see in the Google structured
   tool is basically all the text on the landing page.
 * ?

Viewing 15 replies - 1 through 15 (of 23 total)

1 [2](https://wordpress.org/support/topic/schema-markup-error-2/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/schema-markup-error-2/page/2/?output_format=md)

The topic ‘schema markup error’ is closed to new replies.

 * ![](https://i0.wp.com/themes.svn.wordpress.org/generatepress/3.6.1/screenshot.
   png)
 * GeneratePress
 * [Support Threads](https://wordpress.org/support/theme/generatepress/)
 * [Active Topics](https://wordpress.org/support/theme/generatepress/active/)
 * [Unresolved Topics](https://wordpress.org/support/theme/generatepress/unresolved/)
 * [Reviews](https://wordpress.org/support/theme/generatepress/reviews/)

 * 23 replies
 * 2 participants
 * Last reply from: [Tom](https://wordpress.org/support/users/edge22/)
 * Last activity: [7 years ago](https://wordpress.org/support/topic/schema-markup-error-2/page/2/#post-11541007)
 * Status: not resolved