
You publish a Webflow CMS page and notice it: a big colored stripe with nothing inside, a "Testimonials" section with no testimonials, or a blank card where a gallery should be. The CMS item just didn't have content for that area, but the wrapper section still shows up and breaks the layout.
In this guide, you'll learn how to hide those empty Webflow CMS sections using native tools and minimal code. We'll cover both empty CMS fields and empty CMS lists, and walk through practical patterns you can reuse on any project.

Cleaner layouts on Webflow collection pages: Avoid random blank bands, cards, or grid cells when clients skip optional fields like videos, galleries, or links.
More professional Webflow marketing pages: Service pages, portfolios, and blogs look intentionally designed instead of "broken" when a section is missing content.
Better UX on Webflow job boards and directories: When there are no jobs or no related items, you can show a clear message or remove that block instead of leaving an empty hole.
Less manual editing for Webflow clients: Clients only manage CMS fields and switches – Webflow conditional visibility takes care of what should show or hide automatically.
Responsive layouts that actually hold up: Hiding empty sections at the wrapper level keeps spacing consistent across breakpoints instead of leaving weird gaps on mobile.
Before adjusting your layout, it’s important to understand how Webflow’s conditional visibility works. This feature lets you show or hide elements based on rules tied to CMS fields, ecommerce fields, or user state — and for this article, we’ll focus on CMS fields. Webflow only renders an element when all of its conditions are true. Filters determine which CMS items appear in a Collection List, while conditional visibility controls which elements or sections appear inside those items or on a Collection Page. To apply conditional visibility, you simply select an element, open the Element settings panel, scroll to Visibility & user access, click + Add condition, choose a Collection field, set a rule like Field is set, Field is not set, or Switch is ON, and save your changes.
Before building rules, you'll get better results if your CMS is structured with optional content in mind. This is quick, but it saves a lot of pain later.
Tip: When in doubt, add a Switch field. Switch fields are reliable triggers for conditional visibility and avoid weird edge cases (especially with rich text).

This method is perfect for small CMS-driven blocks: social link rows, "Download brochure" buttons, video embeds, or secondary text areas that are not always filled.
Once the element is bound, its visibility can be controlled by that same field.

If the field is empty for an item, Webflow simply doesn't render that element at all – no space, no empty icon, nothing.
Tip: If you have a row with several social icons, you can put each icon in its own Link block and give each one its own conditional visibility rule based on its matching URL field. The whole row will naturally shrink when some fields are empty.
Rich text fields can be a bit confusing: sometimes they look visually empty in the CMS, but technically still contain hidden characters, so Field is set returns true and your block refuses to hide.
To avoid that:
Tip: Any time conditional visibility does something odd with a field, fall back to a Switch. Switch-based rules are predictable and easy for non-technical editors to understand.
Now let's move from individual elements to full sections. This is what you need when, for example, a product doesn't have a gallery, or a project doesn't have testimonials, and you want the entire band (heading, content, padding, background color) gone.
This wrapper is where you'll apply the visibility rule.
If that field is empty or the switch is OFF, the entire section wrapper disappears – including its padding and background.

Tip: Always put the condition on the outermost wrapper that controls spacing. If you only hide the inner content, you'll still see an empty colored box or gap.
Sometimes the issue isn't a single field – it's a whole Collection list that has zero items. Typical examples:
Webflow doesn't have a native "if this list is empty then hide the parent" checkbox, but you can handle this with a simple CSS snippet.
When a Webflow collection list has no items to display (either because the collection is empty or because all items are filtered out), Webflow automatically adds a special element to the list with the class .w-dyn-empty. This element contains the "No items found" message you see in the Designer.
This .w-dyn-empty element is your hook for detecting empty lists. If it exists in the DOM, the list is empty. If it doesn't exist, the list has items.
Before you write any CSS, you need a way to target the specific sections you want to hide.

This creates a custom HTML attribute that marks this section as one that should be hidden if it contains an empty collection list.
Repeat this for every section on your site that wraps a collection list and should be hidden when that list is empty.
Now you'll add a small CSS snippet that finds sections with your custom attribute and hides them if they contain the .w-dyn-empty class.
Go to your Project settings (click the gear icon in the left sidebar) → Custom code → scroll to the Head code section.
Add this CSS inside <style> tags:
<style>
[data-content-type="CMS"]:has(.w-dyn-empty) {
display: none;
}
</style>

Let's break down what this does:
Click Save changes, then publish your site. Visit a page where one of your collection lists is empty—the entire section should now be hidden, leaving no gap in your layout.
The CSS :has() selector is supported in all modern browsers as of 2024, including Chrome, Safari, Firefox, and Edge. This covers the vast majority of your visitors.
For most Webflow sites, this isn't a concern—your analytics probably show negligible traffic from outdated browsers. In the rare case where a visitor's browser doesn't support :has(), they'll simply see the empty section with the "No items found" message, which is a graceful degradation rather than a broken experience.
Once your conditional visibility rules are in place, testing is crucial so you don't ship unexpected layout gaps.
One item with all optional fields filled out.
One item with key fields empty or switches turned OFF.
Use the Preview mode and navigate through items with the Collection page settings panel.
Confirm that the section is visible when content is present and fully gone when it is not.
Switch between Desktop, Tablet, Landscape, and Portrait breakpoints.
Make sure spacing and backgrounds look intentional with and without the optional section.
Some CMS behaviour is only fully reliable on the published site.
Visit a few live URLs for items with different content combinations.
Section hides but leaves a big empty gap Make sure the conditional visibility is applied to the outermost Section or Div block that controls padding and background, not only to inner text or images. The outer wrapper must have the visibility rule, otherwise you'll see empty colored space even when inner content is hidden.
Webflow rich text CMS block still shows when it looks empty Rich text fields may contain invisible characters even after deletion. Add a Switch field like Show block? and drive conditional visibility from that switch instead of the rich text field. This gives you explicit, reliable control over when sections appear.
Conditional visibility options don't show CMS fields in Webflow Confirm the element lives inside a Collection list item or on a Collection page, and that your page is bound to the correct collection. If the element isn't in a CMS context, CMS fields won't appear as visibility options.
Empty Webflow Collection list shows default "No items" text you don't want Edit the Empty state of the Collection list in the Designer. You can either restyle it with helpful messaging and design that matches your site, or set its Display to None if you prefer showing nothing at all.
Element hides for all items in a Webflow Collection list Double-check your visibility rule and ensure you're targeting the correct field. Conditions use AND logic, so if you add multiple conditions, all must be true. Start with a single condition like Field is set and test before adding more complexity.
Sections hidden on Desktop but visible on Tablet/Mobile Webflow's responsive breakpoints don't affect conditional visibility directly, but they can affect your section structure. If you've used responsive visibility settings at different breakpoints, make sure the outermost section element has the conditional visibility rule applied at every breakpoint where the section exists.
Webflow doesn't offer a direct "hide parent when list is empty" toggle, but you have solid patterns to choose from. The best approach is using CSS with the :has() selector: add a custom attribute like data-content-type="CMS" to your section wrapper, then use CSS to hide sections containing the .w-dyn-empty class. Alternatively, design a good Empty state inside the Collection list so users see a helpful message instead of a broken blank section. For completely no-code solutions, you can wrap the section in a Collection list connected to a small "settings" collection and control visibility with a Switch field. Each method has trade-offs between automation and simplicity.
Select the div or block you want to hide, open the Element settings panel, and add conditional visibility based on the field you've bound. Choose the CMS field (for example, Download URL or LinkedIn URL) and set the rule to Field is set. That tells Webflow to render the block only when the field has real data. For social rows with multiple icons, put each icon inside its own Link block and give each one a separate condition. This way, items with partial data automatically show only the icons they need, and items with no data show nothing at all. The element doesn't just hide—it doesn't render in the HTML at all.
If you're seeing a colored stripe with no content, it usually means you hid the inner elements but not the outer wrapper. Group the entire band—heading, content, and decorative elements—inside a single Section or Div block and apply conditional visibility to that wrapper instead. Use a driver field like Gallery image 1, Main testimonial, or a Switch field such as Has testimonials?. Set the rule so the section is visible only when the field is set or the switch is ON. When the field is empty, Webflow removes the wrapper and its padding, making the colored stripe disappear entirely without leaving any gap in your layout.
In the Element settings panel, scroll to Conditional visibility and click + Add condition. Choose the relevant CMS field, for example Video URL, and set the rule to Video URL is set. This tells Webflow to show that element only when the CMS item includes a real value. You can reuse the same pattern with text, image, number, and switch fields. Remember that multiple conditions stack with an AND logic—all conditions must be true for the element to appear. Start with one simple rule first, test it thoroughly, and only add more complex conditions if your design actually requires them.
Yes. On a Collection page, you can hide an entire section based on any field in the current item. Wrap all elements for that section inside a Section or Div block and select it. Then in Element settings, add a condition such as Gallery image 1 is set or Has gallery? is ON. Webflow then checks that rule for each CMS item when rendering the page. When the field is empty or the switch is OFF, the section doesn't render at all—not even in the HTML. This is perfect for optional galleries, testimonials, video sections, or extra CTAs you only want to show on some collection items.
A common pattern is a heading like "Related posts" above a Collection list that sometimes returns zero items. One solution is to place the heading inside the same wrapper as your collection list and use the CSS method: add data-content-type="CMS" to that wrapper section, then add CSS that hides sections containing .w-dyn-empty. This hides both the heading and the empty list together. Alternatively, use a Switch field in a small "settings" collection—bind a single-item Collection list to those settings, wrap both the heading and "Related posts" list inside it, and apply conditional visibility based on a switch like Has related posts?. When the switch is OFF, both the heading and the list disappear.
Rich text fields can contain invisible markup even when they look empty. If you rely on Field is set, Webflow may still treat that field as non-empty and keep your section visible. The safest solution is to add a Switch field such as Show extra content? and use that for conditional visibility instead of checking the rich text field directly. Editors then turn the switch OFF when they don't want that block on the page, giving you explicit control. If you really want to rely on the rich text field, open each CMS item, click into the rich text editor, select all content (even if nothing appears), delete it completely, and save. That fully clears the content so the field truly counts as empty.
When a block stays visible unexpectedly, first ensure the condition is targeting the correct Collection field—verify you didn't accidentally choose the wrong collection or a different field with a similar name. Second, check if you have multiple conditions applied; Webflow uses AND logic, so if another condition is always true, it might be keeping the element visible regardless of your empty field. Third, for Rich text fields, invisible characters can make the field count as "set" even when it looks blank. In that case, switch to a Switch field as your visibility trigger instead. After adjusting any conditions, always republish your site and test on the live URL rather than relying only on Designer preview.
This usually happens when the visibility rule is attached only to inner elements instead of the container that controls layout spacing. For example, hiding the text inside a grid card but leaving the card wrapper visible will still reserve space in the grid. To fix this, move your conditional visibility up to the card's Div block or Collection item wrapper—the element that actually occupies space in your grid. On full-width bands, apply the rule to the top-level Section instead of just headings or paragraphs. After you move the condition to the correct wrapper element, test again on desktop and mobile breakpoints to make sure the grid or layout reflows naturally with no leftover gaps.
Start by designing your collections with optional content in mind. Group fields for each section together in the CMS and add Switch fields like Has gallery?, Show testimonials?, or Has open jobs? wherever content might be missing—this gives you explicit control over visibility. Always apply conditional visibility on the outermost wrapper controlling padding and background, not just individual text blocks or images inside. For collection lists that can be empty, design an intentional Empty state with helpful copy instead of leaving the default "No items found" message. Document the rules clearly in CMS Help text so clients understand how switches and fields affect what appears on the live site. If you follow these patterns from the start of your project, empty CMS sections simply won't reach your published site.
Once you start using Webflow's conditional visibility and CSS methods intentionally, those ghost sections and awkward colored stripes disappear. Optional content behaves like it should: when the CMS has data, sections appear; when it doesn't, the layout closes up cleanly.
The key is choosing the right approach for each scenario. Use native conditional visibility for individual elements and sections on collection pages where you're checking specific fields. Use the CSS :has() method when you need to hide entire sections that wrap collection lists on static pages. Both approaches are straightforward to implement and maintain.
From here, you can explore more advanced visibility patterns for ecommerce, user accounts, and filtered lists. And if you ever want an expert team to architect your Webflow CMS, design clean templates, and handle all the edge cases for you, you can reach out to our Webflow agency at BRIX Templates for hands-on help.

Framer maintenance: platform costs, optional services, when support is needed, and how retainers, unlimited plans, or self-management compar

Webflow maintenance explained: platform costs, optional services, when to hire support, and how retainers, unlimited plans, or self-manageme

Framer website costs explained: pricing factors, agency tiers, cost calculator, and how to choose between freelancers or agencies.