# WIP: Stale text stays in the element data after a copy or edit, and "Query Bricks data in search results" then returns irrelevant posts

**URL:** <https://forum.bricksbuilder.io/t/wip-stale-text-stays-in-the-element-data-after-a-copy-or-edit-and-query-bricks-data-in-search-results-then-returns-irrelevant-posts/40876>\
**Category:** Bugs\
**Tags:** v2-4-5\
**Created:** [November 25, 2026, 2:34pm UTC](https://forum.bricksbuilder.io/t/wip-stale-text-stays-in-the-element-data-after-a-copy-or-edit-and-query-bricks-data-in-search-results-then-returns-irrelevant-posts/40876 "2026-11-25T14:34:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![joep](https://forum.bricksbuilder.io/letter_avatar_proxy/v4/letter/j/87869e/32.png) [@joep](https://forum.bricksbuilder.io/u/joep)\
**Post date:** [November 25, 2026, 2:34pm UTC](https://forum.bricksbuilder.io/t/wip-stale-text-stays-in-the-element-data-after-a-copy-or-edit-and-query-bricks-data-in-search-results-then-returns-irrelevant-posts/40876/1 "2026-11-25T14:34:27Z")

</div>

**Environment**

- Bricks 2.4.5, WordPress 7.1.5, PHP 8.1.34, MariaDB 10.6.28
- Setting: Query Bricks data in search results = ON
- Custom search criteria and weight score enabled (Bricks → Search criteria)
- Search results use a Query Loop with a PHP query: `post_type => ['informatie','cursus'], 's' => get_search_query()`

**What happened**  
Searching `/?s=miskraam` returns posts that don’t contain “miskraam” anywhere in the visible page, the HTML source, the title, the excerpt or the ACF fields.

**How we investigated**

1. We logged the search SQL. It shows that, besides title, excerpt and post\_content, Bricks adds `bricksdata.meta_key = '_bricks_page_content_2' AND bricksdata.meta_value LIKE '%miskraam%'`.
2. We ran a query on `_bricks_page_content_2` for matching posts. This returned 10 posts, 5 of which only matched via the Bricks data.
3. We audited the unserialized element arrays. The match is on the root **section** (CSS ID `blok-opener-center`) of those posts. The elements are correctly attached, not orphaned, and there are no duplicate meta rows.
4. The section’s settings contain a `text` key with a paragraph about miskraam, copied from another article. A section has no text control, so it is not visible in the builder UI, not in the Structure panel and not in the frontend HTML. It can’t be edited or removed from the UI.
5. We confirmed that none of the child text elements contain the word.
6. With the setting OFF, search returns only title and excerpt matches. That is as expected, but our body text lives in Bricks elements, so we can’t leave it off.

**Expected result**  
Search should only match content that is rendered on the page. When an element is copied, reused or changed, the old content should not stay behind in the stored data.

**Actual result**  
Old content values stay in the stored element settings, invisible in the UI. The raw `LIKE` on the serialized data matches them, so unrelated posts appear in the search results.

**What we expect from Bricks**

- When an element is copied/pasted, or its type or content is changed, settings that no longer apply should be emptied or removed on save (no leftover strings).
- And/or “Query Bricks data in search results” should only search text-bearing settings that actually render, not every key in the serialized element data.

---

<div class="post-metadata">

**Author:** ![timmse](https://forum.bricksbuilder.io/user_avatar/forum.bricksbuilder.io/timmse/32/1192_2.png) [@timmse](https://forum.bricksbuilder.io/u/timmse)\
**Post date:** [November 26, 2026, 8:05am UTC](https://forum.bricksbuilder.io/t/wip-stale-text-stays-in-the-element-data-after-a-copy-or-edit-and-query-bricks-data-in-search-results-then-returns-irrelevant-posts/40876/3 "2026-11-26T08:05:46Z")

</div>

Hi Joep,  
Thanks for the detailed report. We reproduced a native Bricks issue that can cause this: converting a mixed selection of a Dropdown and a layout element to Sections can leave the Dropdown’s text stored but invisible. Search still matches that hidden text.

We cannot confirm whether this caused the data on your site, but we’ve added the reproduced issue to our internal bug tracker and will update this thread once it’s fixed.
