So, you’re implementing structured data on your site, particularly using JSON-LD (the latest Google recommendation regarding structured data), but when testing the file or the code used via the Structured Data Testing Tool, you receive an error–particularly this:
JSON-LD Missing '}' or object member name.
Fortunately, it has a pesky but quick fix. All you have to do is look for the superfluous trailing comma(s) throughout your code.
For instance, in the image below, you’ll notice in lines 15 and 19 they end with ‘,’ but should be removed.
And, boom, here’s the result of testing once i removed the commas on lines 15 and 19. Hopefully that helps you and your structured data implementation.
{ "@context": "https://schema.org", "@type": "Restaurant", "description":"Some example code for an Organization using JSON-LD.", "name": "My Custom Restaurant", "image": "https://macariojames.com/blog/wp-content/themes/hexo/assets/home/images/macariojames_tech_design_web_dev_consulting_logo2.jpg", "url": "https://yoururl.com/", "logo": "https://yoururl.com/yourlogo.png", "address": { "@type": "PostalAddress", "addressLocality": "New Orleans", "addressRegion": "LA", "postalCode": "97202", "streetAddress": "Address Goes Here ", "addressCountry": "US" }, "priceRange": "$$", "servesCuisine": "Hot Wings", "telephone": "504 123 4567" }
Cheers. Happy coding!
(Visited 386 times, 1 visits today)
Find Out When New Blog Posts are Published via pop-up when closing this browser tab
Wondering why you keep seeing lower-cased 'i' in my posts? Read -> Why ‘i’ is not capitalized
Subscribe
Login
0 Comments