You apply a filter in a Notion database to show only pages where a text property is empty. But pages that appear to have no text still show up. The cause is invisible whitespace characters such as spaces, tabs, or line breaks that Notion treats as non-empty content. This article explains why whitespace values bypass the Is Empty filter and how to remove them.
Key Takeaways: Handling Whitespace in Notion Database Filters
- Is Empty filter behavior: Notion treats whitespace-only content as non-empty, so pages with invisible characters still pass the filter.
- Trim formula: Use the trim() function in a formula property to strip leading and trailing whitespace from text.
- Replace formula: Use the replaceAll() function to remove all whitespace characters including tabs and newlines.
Why Notion Treats Whitespace as Non-Empty Content
Notion stores text exactly as typed, including invisible characters. When you press the space bar or Enter inside a text property, Notion records that character. The Is Empty filter checks whether the property contains any character at all. Because a space or newline is a valid Unicode character, the property is not empty.
This behavior matches how most databases and programming languages handle strings. A string that contains only whitespace is not null or undefined; it has a length of one or more. Notion’s filter logic follows this standard, which means a page with a single space in a property will not match the Is Empty condition.
Whitespace can enter your database in several ways. You may accidentally press the space bar after deleting text. Copying and pasting from web pages or documents often brings hidden spaces or tabs. Importing data from CSV files can also introduce non-breaking spaces or other invisible Unicode characters.
Steps to Identify and Remove Whitespace from Text Properties
To fix the filter behavior, you need to clean the text property of all whitespace characters. The best approach uses a formula property that strips whitespace, then filter based on that cleaned value.
Method 1: Using the Trim Formula to Remove Leading and Trailing Whitespace
- Create a formula property
Add a new property to your database. Click the + icon in the top-right of the database view. Choose Formula from the property type list. Name it something like “Cleaned Text”. - Enter the trim formula
In the formula editor, type:trim(prop("Your Property Name")). Replace “Your Property Name” with the exact name of the text property you want to clean. Click Save. - Apply a filter on the formula property
Click the Filter button above the database. Add a condition: “Cleaned Text” Is Empty. This filter will now show only pages where the original property had no visible text and no leading or trailing whitespace.
Method 2: Using ReplaceAll to Remove All Whitespace Characters
The trim function only removes spaces at the start and end of the text. If whitespace appears in the middle of the text, trim will not remove it. Use replaceAll to eliminate every whitespace character.
- Create a new formula property
Add another formula property. Name it “No Whitespace”. - Enter the replaceAll formula
In the formula editor, type:replaceAll(prop("Your Property Name"), "[[:space:]]", ""). This pattern matches spaces, tabs, newlines, and non-breaking spaces. Click Save. - Filter on the cleaned property
Add a filter condition: “No Whitespace” Is Empty. This will show only pages where the original property had no visible characters at all.
Method 3: Manual Inspection and Cleaning
- Open the page with the suspect property
Click into the page. Click on the text property value to edit it. - Select all text in the field
Press Ctrl+A on Windows or Cmd+A on Mac to select everything in the property. - Delete and retype
Press Delete or Backspace to remove the selection. Type the intended text again. This removes any hidden whitespace that was present.
If Notion Still Shows Pages with Whitespace Values
Filter Condition Reverses After Cleaning
After you apply the formula-based filter, you might notice that the original filter still shows unexpected pages. Make sure you are filtering on the formula property, not the original text property. Remove the old filter on the text property and add the new filter on the formula property.
Formula Shows Error or Invalid Syntax
If the formula editor shows a red error message, check the property name in the formula. Property names are case-sensitive and must match exactly. Use the property name as it appears in the database header. If the name contains spaces, enclose it in double quotes: prop("My Property Name").
Non-Breaking Spaces Are Not Removed
Some imported data contains non-breaking spaces (Unicode U+00A0). The replaceAll formula with [[:space:]] does not catch non-breaking spaces. To remove them, use a more specific formula: replaceAll(replaceAll(prop("Your Property Name"), "\u00A0", ""), "[[:space:]]", ""). This first removes non-breaking spaces, then removes all other whitespace.
Notion Filter Methods for Empty Text Values Compared
| Item | Is Empty filter on text property | Is Empty filter on trim formula | Is Empty filter on replaceAll formula |
|---|---|---|---|
| Catches truly empty cells | Yes | Yes | Yes |
| Catches cells with only leading/trailing spaces | No | Yes | Yes |
| Catches cells with only tabs or newlines | No | No | Yes |
| Catches cells with non-breaking spaces | No | No | Only with extra replaceAll step |
| Requires new property | No | Yes | Yes |
Now you know why the Is Empty filter catches pages with whitespace values and how to clean your data. Use the trim formula for quick cleanup of leading and trailing spaces. Use the replaceAll formula for thorough removal of all whitespace characters including tabs and newlines. For imported data, add the extra replaceAll step to handle non-breaking spaces.