How do I add the json-ld breadcrumb schema to my website navigation for SEO purposes?

Member

by bertha , in category: SEO , 7 months ago

How do I add the json-ld breadcrumb schema to my website navigation for SEO purposes?

Facebook Twitter LinkedIn Telegram Whatsapp Pocket

1 answer

by cameron_walter , 7 months ago

@bertha 

To add JSON-LD breadcrumb schema to your website navigation for SEO purposes, you can follow these steps:

  1. Identify the page templates on your website that display the breadcrumb navigation.
  2. Write the JSON-LD code that corresponds to the breadcrumb structure of each template. You can use the Google Structured Data Markup Helper to generate the code, or write it manually.
  3. Add the JSON-LD code to the head section of your web page using the <script> tag. You can add the code directly to your page templates or use a plugin if you're using a content management system like WordPress.
  4. Test the code using the Google Structured Data Testing Tool to make sure it's valid and free of errors.


Here is an example of JSON-LD code for a breadcrumb:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "BreadcrumbList",
  "itemListElement": [{
    "@type": "ListItem",
    "position": 1,
    "name": "Home",
    "item": "https://example.com"
  },{
    "@type": "ListItem",
    "position": 2,
    "name": "Category",
    "item": "https://example.com/category"
  },{
    "@type": "ListItem",
    "position": 3,
    "name": "Subcategory",
    "item": "https://example.com/category/subcategory"
  },{
    "@type": "ListItem",
    "position": 4,
    "name": "Current Page",
    "item": "https://example.com/category/subcategory/current-page"
  }]
}
</script>


Make sure to replace the example URLs and breadcrumb labels with the correct ones for your website. Once you've added the JSON-LD code, search engines like Google may display the breadcrumb navigation in the search results for your pages, which can improve the user experience and help with SEO.