How to Implement a Search Functionality on Your Webflow CMS List Page πŸ”

Ever built a Webflow CMS list and thought,
"Wow, this looks great! But wait… how do users search for stuff?" 😩

Unfortunately, Webflow doesn’t have a built-in CMS search. But don’t worryβ€”today, we’ll fix that! 😎

In this guide, we’ll cover two easy ways to add search functionality:

1️⃣ The No-Code Way – Using Finsweet Attributes
2️⃣ The Custom Code Way – Using JavaScript for Real-Time Filtering

Let’s gooo! πŸš€

‍

‍

πŸ”Ή Part 1: Adding CMS Search Using Finsweet Attributes (No Code!)

πŸ”— Website: https://www.finsweet.com/attributes/cms-search

Finsweet Attributes is a free tool that extends Webflow’s functionality without writing code. It makes adding search super simple.

‍

πŸ›  Step 1: Set Up Your Webflow CMS Page

Before we start, you need:
βœ… A Webflow CMS Collection List (e.g., blog posts, products, team members)
βœ… A Search Input Field

If you don’t have a search field yet, just add:

  • An Input Field (Form β†’ Input)
  • A CMS Collection List (your list of items)

‍

πŸ”— Step 2: Add Finsweet Attributes to Webflow

1️⃣ Select your CMS Collection List

  • Go to the Element Settings Panel
  • Add the custom attribute:
    • Name: fs-cmssearch-element
    • Value: list

2️⃣ Select your Search Input Field

  • Add another custom attribute:
    • Name: fs-cmssearch-element
    • Value: input

Your setup should look like this:

πŸ“Έ (Insert image of Webflow settings panel with attributes added)

‍

⚑ Step 3: Add the Finsweet Script

Go to Page Settings β†’ Custom Code (Before </body>) and paste this:

html

CopyEdit

<script src="https://cdn.jsdelivr.net/npm/@finsweet/attributes-cmssearch@1/cmssearch.js"></script>

‍

βœ… Done! Now Test Your Search

πŸ” Type anything in the search box, and watch your CMS list filter dynamically! πŸŽ‰

πŸ”₯ Why Use Finsweet Attributes?
βœ”οΈ No coding required
βœ”οΈ Works instantly with large CMS lists
βœ”οΈ Super fast and reliable

But what if you want full control over the search behavior? That’s where custom JavaScript comes in. πŸ‘‡

‍

‍

‍

πŸ”Ή Part 2: Implementing a Custom JavaScript Search Function (For Developers) πŸš€

Now, let’s build a real-time search function that filters items as you type.

‍

πŸ›  Step 1: Add the HTML Elements

Inside your Webflow project, add:

  • A Search Input Field (give it the class search-input)
  • A CMS Collection List (give it the class cms-list)
  • Each CMS item should have a wrapper (cms-item) and a title inside (cms-title)

Your Webflow structure should look like this:

πŸ“Έ (Insert image of Webflow Navigator panel with correct class names)

‍

⚑ Step 2: Add the Custom JavaScript

Now, let’s add the magic! Go to Page Settings β†’ Custom Code (Before </body>) and paste this:

<script>
document.addEventListener("DOMContentLoaded", function () {
  const searchInput = document.querySelector(".search-input");
  const cmsItems = document.querySelectorAll(".cms-item");
  
  const cleanText = (text) => {
    return text
      .toLowerCase()
      // Remove accents/diacritics
      .normalize("NFD")
      .replace(/[\u0300-\u036f]/g, "")
      // Remove punctuation
      .replace(/[.,\/#!$%\^&\*;:{}=\-_`~()'"]/g, " ")
      // Replace multiple spaces
      .replace(/\s+/g, " ")
      .trim();
  };
  
  // Optional: Cache cleaned titles for better performance
  const cleanTitles = new Map();
  cmsItems.forEach(item => {
    const titleElement = item.querySelector(".cms-title");
    if (titleElement) {
      cleanTitles.set(item, cleanText(titleElement.innerText));
    }
  });
  
  let timeout;
  
  searchInput.addEventListener("input", function () {
    clearTimeout(timeout);
    
    timeout = setTimeout(() => {
      const filterText = cleanText(searchInput.value);
      const searchWords = filterText.split(" ").filter(word => word.length > 0);
      
      // If search is empty, show all items
      if (searchWords.length === 0) {
        cmsItems.forEach(item => item.style.display = "block");
        return;
      }
      
      cmsItems.forEach((item) => {
        if (!cleanTitles.has(item)) return;
        
        const titleWords = cleanTitles.get(item).split(" ");
        const isMatch = searchWords.every(searchWord => 
          titleWords.some(titleWord => 
            titleWord.includes(searchWord)
          )
        );
        
        item.style.display = isMatch ? "block" : "none";
      });
    }, 300);
  });
});
</script>

‍

βœ… Done! Now Test Your Custom Search

πŸ–Š Type in the search bar, and the CMS items will dynamically filter in real time as you type. 🎯

πŸ”₯ Why Use Custom JavaScript?
βœ”οΈ No external dependencies – Works without Finsweet
βœ”οΈ More control – Customize it to filter by multiple fields
βœ”οΈ Super lightweight – Works instantly

‍

πŸ†š Finsweet Attributes vs. Custom JavaScript – Which One to Use?

Feature Finsweet Attributes πŸ›  Custom JavaScript πŸ§‘β€πŸ’»
Ease of Use βœ… Super easy (no code) ❌ Requires coding
Performance βœ… Optimized for large lists βœ… Fast, but manual setup
Customization ❌ Limited (pre-built) βœ… Fully customizable
Third-Party Script? βœ… Yes (Finsweet library) ❌ No external scripts
Best For No-code users πŸ‘Ά Developers & advanced users πŸ‘¨β€πŸ’»

‍

🎯 Final Thoughts

And there you have it! πŸŽ‰ You just learned two powerful ways to add real-time search to your Webflow CMS List page.

πŸš€ Which One Should You Choose?

πŸ’‘ If you don’t want to code, use Finsweet Attributes.
πŸ’‘ If you want full control, go with custom JavaScript.

Either way, your Webflow site now has a search function that actually works! πŸ”₯

‍

‍