How to add JSON-LD structured data? BlogPosting, BreadcrumbList and Organization examples
Create, validate and publish BlogPosting, BreadcrumbList and Organization schemas as JSON-LD compatible with the visible content of the page.
JSON-LD structured datais a machine-readable block of data used to help search engines more clearly interpret the person, institution, article and navigation path on the page. Google generally recommends the JSON-LD format for the search view types it supports.
Adding schema does not guarantee ranking or rich results. The flagged information must be visible to the user on the page, must be the same as the actual content, and must be presented with each page's own URL, title, image and date values.
How to add JSON-LD to the page?
dataapplication/ld+jsonYou can publish it in head or body with the script tag of type . Generate the fields in the following BlogPosting example from the existing blog record on the server side:
The title and description must have the same meaning as the visible page.dateModifiedDo not automatically convert its value to today on every page request; Update only on meaningful content change.
BreadcrumbList example
BreadcrumbList defines the category path the user sees. The locations are listed starting from one:
Breadcrumb links must comply with the canonical URL scheme, and category paths that are imaginary or not visible to the user should not be added.
Unify Organization data under a single identity
Instead of repeating the corporate name, URL and logo with different values on each page,@idyou can use The BlogPosting publisher field on the same page can be linked to this ID:
{
"@context": "https://schema.org",
"@type": "Organization",
"@id": "https://www.example.com/#organization",
"name": "Example Teknoloji",
"url": "https://www.example.com/",
"logo": "https://www.example.com/logo.png"
}
Multiple nodes in one script@graphYou can also present it with . Using separate script blocks is also valid; The important thing is that identities and fields do not conflict.
Don't forget security in dynamic production
Do not place user-enterable values, such as a title, into JSON by string concatenation. Generate it with the JSON serializer of the language you use; This way quotes, line breaks and special characters are escaped correctly. When embedding in HTML, use your framework's safe output method against strings such as closing tags.
Do two separate tests before publishing
Check the rich result fields supported by Google with Google Rich Results Test and the general schema structure with Schema.org Validator. Then verify that the script is present in the live HTML source, the URLs return 200, and the image is crawlable. Search Console development reports show actual crawl status after publication.
Short guide
Common mistake
Adding rating, author or category information that is not visible on the page to JSON-LD just to make the schema look more complete.