Structured Data Testing Tool

https://search.google.com/structured-data/testing-tool



I have some errors:

* Missing field item breadcrumbs

why??
<ul class="breadcrumb trail-items" itemscope="" itemtype="http://schema.org/BreadcrumbList">
    <meta name="numberOfItems" content="3">
    <meta name="itemListOrder" content="Ascending">
    <li class="trail-item trail-begin" itemprop="itemListElement" itemscope="" itemtype="http://schema.org/ListItem"><a href="my home url" rel="home" itemprop="item"><span itemprop="name">my main site title</span></a>
        <meta itemprop="position" content="1">
    </li>
    <li class="trail-item" itemprop="itemListElement" itemscope="" itemtype="http://schema.org/ListItem"><a href="my tag url" itemprop="item"><span itemprop="name">tag 1</span></a>
        <meta itemprop="position" content="2">
    </li>
    <li class="trail-item trail-end" itemprop="itemListElement" itemscope="" itemtype="http://schema.org/ListItem"><a href="my post url" itemprop="item"><span itemprop="name">my post title</span></a>
        <meta itemprop="position" content="3">
    </li>
</ul>

Reason:

  1. URL in attribute of href in a tag have have space " " character
  2. Text in a tag have hash "#" character


=> resolve:
var tagUrl= 'https://example.com/tag/'+ encodeURI(tagText);
var tagTextFix= tagText..replace(/#/g, '');

Recommend:
Structured Data by tag script type="application/ld+json":
render html => send variable: data: {jdjson: JSON.stringify( inforPostItem )}


Comments