Exclude Sections From Training (CSS Filters)

Boei automatically strips common boilerplate (navigation, footers, sidebars, cookie banners, comment sections, ads) when crawling pages. For most sites, this is enough.

If you need more control, CSS filters let you tell Boei exactly which sections of a page to skip (or keep) while leaving the page untouched for your visitors. This is an advanced feature for fine-tuning.

How to get there: Go to Setup → Chatbot in the top menu → click your chatbot → Training → Website tab → find your website source → click the settings (gear) icon.

When to Use CSS Filters

Cases where the automatic stripping isn't enough:

  • Related-products carousels on product pages that inflate character counts and confuse the chatbot with dozens of off-topic product names
  • Cross-sell and upsell blocks that appear on every product page
  • Promotional widgets or newsletter signups in sidebars
  • Comment sections on blog posts that survive the default filter

Sections you strip stay visible to your customers on the site. Boei only excludes them from training data.

How It Works

You provide CSS selectors, which are short codes that identify parts of a web page. If you've ever inspected a web page in your browser, you've seen these. Here are some examples:

Selector What it matches
.related-products Any element with class related-products
#products-list-footer The element with id products-list-footer
.cross-sell Any element with class cross-sell
aside All <aside> tags on the page
footer The page footer

You can list multiple selectors, one per line.

Setting Up Exclude Filters

  1. Go to Training → Website tab

  2. Find the website source you want to configure

  3. Click the settings (gear) icon next to it

  4. In the Exclude CSS Selectors field, paste one selector per line:

       .related-products
       .cross-sell
       #products-list-footer

  5. Click Save Changes

Filters apply on the next crawl of each page. Pages that were already trained keep their current content until they are re-crawled.

Applying Filters to Already-Trained Pages

If you already trained pages before adding filters, they need to be re-crawled:

  • Sitemap sources: click Sync Now in the source's action menu. Every page gets re-crawled with the new filters.
  • Crawler sources: re-train the individual pages (select them and click Train), or wait for your next auto-sync.
  • New pages added after you set the filters use them automatically.

Your training-character count drops the moment the re-crawl finishes.

Include Filters (Advanced)

The Include CSS Selectors field does the opposite: if set, the chatbot only trains on content inside the listed selectors and ignores everything else on the page.

Use this when a site has a clear main-content wrapper:

main
article.post

If left empty (the default), Boei keeps the whole page and applies your exclude filters on top.

Finding the Right Selectors

  1. Open the page in your browser
  2. Right-click the section you want to remove
  3. Choose Inspect (Chrome, Edge, Firefox, Safari)
  4. In the DevTools panel, look at the class="..." or id="..." attribute on the highlighted element
  5. Copy the class (prefix with .) or id (prefix with #) into the Exclude CSS Selectors field

Tips

  • Start with the biggest offenders. Related-products carousels on e-commerce sites can add 10,000+ characters per page. Removing them often cuts a page's training size by more than half.
  • Test on one page first. After you save selectors and re-crawl a page, check the character count went down as expected.
  • Combine with URL paths. If a whole section of your site should be excluded (e.g., /blog/tag/*), use the Include Paths or Exclude Paths fields instead. CSS filters are for sections within pages you do want to train on.
  • Filters are per source. If the same site is added twice (once as a crawler, once as a sitemap) you set the filters on each source independently.

Requirements

  • CSS filters apply to all page types (crawled domains, sitemap sources, page-link lists)
  • They do not apply to Files, Text Snippets, or Q&A sources, which are free-form content you enter directly