Skip to content

SEO / GEO4 min read

How to Create an Automatic Breadcrumb Trail from the URL in Webflow

Learn how to automatically generate breadcrumbs from the URL in Webflow with JSON-LD structured data.

In this tutorial, Sandro, co-founder of the Gemeos Webflow agency, shows you how to automatically generate breadcrumbs from the URL in Webflow, with JSON-LD structured data for SEO.

Example

Breadcrumb generated from the current URL

URLGenerated breadcrumbJSON-LD
www.gemeosagency.com/en/academy/mon-articleHome / Academy / My ArticleYes, automatic
www.gemeosagency.com/fr/blog/postHome / Blog / PostYes, automatic
www.gemeosagency.com/fr/servicesHome / ServicesYes, automatic

1. Create the container in Webflow

Create a Div with the ID breadcrumb where you want the breadcrumb to appear. Set it to display: none by default: the script will make it visible and inject the content.

2. Customize the labels

The labels object turns URL slugs into readable labels. Add your own mappings: 'nos-offres': 'Our offers'.

(function() {
  var container = document.getElementById('breadcrumb');
  if (!container) return;

  var labels = {
    'academie': 'Academy',
    'blog': 'Blog',
    'services': 'Services',
    'realisations': 'Case Studies',
    'contact': 'Contact',
  };

  var parts = window.location.pathname.split('/').filter(Boolean);
  var html = '<a href="/en" style="color:#6b7280;text-decoration:none;">Home</a>';

  var path = '';
  parts.forEach(function(part, i) {
    path += '/' + part;
    var label = labels[part] || part.replace(/-/g, ' ').replace(/\b\w/g, function(c) { return c.toUpperCase(); });
    html += '/';
    if (i === parts.length - 1) {
      html += '' + label + '';
    } else {
      html += '' + label + '';
    }
  });

  container.innerHTML = html;
  container.style.display = 'flex';
  container.style.alignItems = 'center';
  container.style.fontSize = '13px';
  container.style.flexWrap = 'wrap';
  container.style.gap = '0';
})();

4. Add the JSON-LD structured data

This second script automatically generates the BreadcrumbList schema for Google. Add it right after the first one in the Footer code.

// JSON-LD for breadcrumbs (SEO)
(function() {
  var parts = window.location.pathname.split('/').filter(Boolean);
  var items = [{ '@type': 'ListItem', position: 1, name: 'Home', item: window.location.origin }];
  var path = window.location.origin;
  parts.forEach(function(part, i) {
    path += '/' + part;
    items.push({ '@type': 'ListItem', position: i + 2,
      name: part.replace(/-/g, ' '), item: path });
  });
  var script = document.createElement('script');
  script.type = 'application/ld+json';
  script.textContent = JSON.stringify({ '@context': 'https://schema.org',
    '@type': 'BreadcrumbList', itemListElement: items });
  document.head.appendChild(script);
})();

Conclusion

An automatic breadcrumb saves you from managing it manually page by page. Best use cases:

  • Sites with lots of nested pages (blog, academy, docs)
  • E-commerce sites with categories and subcategories
  • Multilingual sites with a consistent URL structure

Published on May 20, 2026

Sandro DA SILVA

Growth Marketer, Webflow expert, and jack-of-all-trades. Sandro handles commercial operations, ensures projects run smoothly, and addresses marketing-related issues (SEO, Tracking, Copywriting, etc).

You're going to working with us, guaranteed

Ready to launch your business?

get a quote

Let’s f*****G GO !!