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

Documentation

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

Available since: 2.7

searchwp_weight_mods

View Parameters »

SearchWP’s backbone is its search algorithm. Fundamentally the algorithm is based on keyword weights to produce the most relevant results. There are circumstances where you may want to inject your own logic into the search algorithm, however. The searchwp_weight_mods lets you do just that.

While you can’t completely omit SearchWP’s weight calculations, you can influence the overall weight of every result by injecting your own SQL statement at just the right time.

Example: If you’d like to have more recently published posts rank higher than older posts, see this KB entry

Parameters

Parameter Type Description
$sql String

The SQL to insert into the main algorithm query alongside the weight calculations

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