Note: You are viewing the documentation for Version 3View Version 4 Docs


View the installation guide, browse the Knowledge Base, find out about SearchWP's many hooks, get support

Available since: 1.1


View Parameters »

If you would like to manually JOIN more tables during the main search query, this filter will allow you to inject your own JOIN clause.

Example: To include your own JOINs, add the following to your active theme’s functions.php:

function my_searchwp_query_join( $sql, $postType, $engine ) {
// modify $sql to your liking
return $sql;
add_filter( 'searchwp_query_join', 'my_searchwp_query_join', 10, 3 );
view raw gistfile1.php hosted with ❤ by GitHub


Parameter Type Description
$sql String

The default SQL

$postType String

The current post type (all post types are iterated)

$engine String

The search engine being used

Fix keyword search on your site. No coding required!

Now you can utilize all of the content that's gone unrecognized by native WordPress keyword search instantly with SearchWP

Get SearchWP