By Flynn O’Connor - @thoronas
This means we can use any of the parameters available to WP_Query for our search query.
Inputs added to the form can control the query. But they must match the corresponding query parameters.
what your form looks like
What your query string looks like
This action will alter the query before it is run.
With this you can do complicated search queries
involving taxonomies and meta values.
Filter posts based on custom post meta.
If you have large chunks of content in custom meta use the "like" comparative parameter
Sometimes you don't want specific content to be searchable. You can specify that content in several ways.
If you allow search for multiple post types
you will probably have different
structure/layout for your content.
If your content looks like this on your site.
But your search results look like this
It is a bad user experience.
You can sort search results by:
The major problem with the built in WordPress search: search results can’t be sorted by relevance
to the search term.
Default search results ordered by relevance instead of date.
Without touching the code you can enable searches within:
Allows keyword searches in all of the above
Because we are using pre_get_posts and passing valid query variables via form elements all of our custom search queries will work with Relevanssi right out of the box.
If you want more control over your results
or search analytics.
An open source search and analytics engine. Installs on your server. Provides analytics, discover popular search terms.
Services like Searchbox.io provide a cloud based Easticsearch for WordPress sites. Easier for non-devs to set up. Removes some of the complex configuration required.
Provides an easy to use plugin WP-Elasticsearch for simple integration through WordPress dashboard.
Cloud based search service, provides easy to implement search alternative.
Tickets on sale June 17th!
Speaker submissions until July 3rd.
Follow us on: