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


Since: 4.0.0

Table of Contents

Customize the weight intervals available when configuring SearchWP Engine Source Attributes.


Type Parameter Default Since
Array $weights Array keys are integers representing weight, value is the label of the weight 4.0.0


All hooks should be added to your custom SearchWP Customizations Plugin.

Customize available Engine Source Attribute weights

// Customize available Engine Source Attribute weights in SearchWP.
add_filter( 'searchwp\weights', function( $weights ) {
// Make available only two weight choices.
return [
1 => 'Lowest',
1000 => 'Highest',
} );

How to use this code

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