by iritru
1 replies
  • SEO
  • |
Hi,

I'm currently working on building my new site's breadcrumbs using https://schema.org/BreadcrumbList. However, I am encountering a problem -
Let's say the code looks like this:

<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "BreadcrumbList",
"itemListElement":
[
{
"@type": "ListItem",
"position": 1,
"item":
{
"@id": "https://example.com/slug1",
"name": "Slug_Name1"
}
},
{
"@type": "ListItem",
"position": 2,
"item":
{
"@id": "https://example.com/slug1/slug2",
"name": "Slug_Name2"
}
}
]
}
</script>

So, my question is - if the URL https://example.com/slug1/slug2 exists but https://example.com/slug1 DOESN'T exist on my site - should I create it anyways and do 301 redirect or is the code valid like written above without having the https://example.com/slug1 URL actually existing?
#breadcrumbs #path
  • Profile picture of the author yukon
    Banned
    Originally Posted by iritru View Post

    Hi,

    I'm currently working on building my new site's breadcrumbs using https://schema.org/BreadcrumbList. However, I am encountering a problem -
    Let's say the code looks like this:

    <script type="application/ld+json">
    {
    "@context": "http://schema.org",
    "@type": "BreadcrumbList",
    "itemListElement":
    [
    {
    "@type": "ListItem",
    "position": 1,
    "item":
    {
    "@id": "https://example.com/slug1",
    "name": "Slug_Name1"
    }
    },
    {
    "@type": "ListItem",
    "position": 2,
    "item":
    {
    "@id": "https://example.com/slug1/slug2",
    "name": "Slug_Name2"
    }
    }
    ]
    }
    </script>

    So, my question is - if the URL https://example.com/slug1/slug2 exists but https://example.com/slug1 DOESN'T exist on my site - should I create it anyways and do 301 redirect or is the code valid like written above without having the https://example.com/slug1 URL actually existing?


    Do not use that code, it's pointless for SEO.

    Use plain HTML. You can serve up the HTML via PHP but it needs to be HTML on the finished webpage source code.

    You don't have to make slug1 a hyperlink in your example, though the breadcrumb path might be confusing for traffic.
    {{ DiscussionBoard.errors[10847214].message }}

Trending Topics