WordPress.org

Make WordPress Core

Opened 7 months ago

Closed 5 months ago

Last modified 7 weeks ago

#45606 closed defect (bug) (maybelater)

WordPress search matches block editor comments and data

Reported by: pat@… Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Query Keywords:
Focuses: Cc:

Description

Since Gutenberg uses the post_content field to store all the block data it drastically impacts search results.

If I create a new post and use a bunch of Column blocks but never use the word 'column' in my content it shows up in results at /?s=column

There are dozens of blocks already and it's entirely open-ended as to how many a site can have.

This seems like a *critical* oversight. Structural components or 'nodes' as they're referred to should not be searchable.

Change History (3)

#1 @inuya5ha
7 months ago

You are right.
Honestly, I don't understand why the WP team has forced every single user to use this new, bugged and unreliable editor, and not even provide the means to keep using the normal editor we are all used to. HUGE STEPBACK with this change, congratulations to all the WP team. What's next? Removing the sidebar from the Admin Panel? Yes, why not...

#2 @desrosj
5 months ago

  • Milestone Awaiting Review deleted
  • Resolution set to maybelater
  • Severity changed from critical to normal
  • Status changed from new to closed
  • Summary changed from Gutenberg ruins Search Results to WordPress search matches block editor comments and data
  • Version 5.0 deleted

Hey @patrelentlesstechnologycom, thanks for this ticket. I am going to include some links to related issues on the Gutenberg GitHub repository for context, and for anyone that stumbles on this ticket in the future.

GB-2718
GB-3739
GB-10247
GB-10307

Also, for prior history of how WordPress' search feature functions, there's #7394. More specifically, [25632], which describes the current priorities within the search logic of WordPress by default.

Unfortunately, this is not a new problem and is not being caused specifically by the new block editor. Take shortcodes, for example. A post with a [gallery] shortcode would be matched for a search query for gallery. Likewise, a search for table would also match posts that contain a <table> HTML tag. These have been included in post_content for many years. MySQL's string searching is just not capable of parsing and excluding certain patterns.

The block editor amplifies this issue because the occurrence of strings like paragraph and 'image' are now far more common than shortcodes were previously.

If your site requires more contextual searching, using something like Elasticsearch will produce much more accurate search results. There are a few plugins and services in the WordPress space that allow you to set this up. Until a better means for searching content in MySQL is introduced, it is unlikely that this is fixed in WordPress Core. I am going to close this as maybelater in case that happens in the future so improvements to search can be explored.

This ticket was mentioned in Slack in #core by desrosj. View the logs.


7 weeks ago

Note: See TracTickets for help on using tickets.