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


Since: 4.0.0

Table of Contents

Control the considered post stati for \WP_Post-based Sources.


Type Parameter Default Since
String[] $post_stati Post stati that are public and not excluded from search 4.0.0
Array $args
Key Type Value
engine String Engine name


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

Include drafts in Supplemental Engine

// Include drafts in SearchWP Supplemental Engine.
function( $post_stati, $args ) {
if ( 'supplemental_engine' === $args['engine'] ) {
$post_stati[] = 'draft';
return $post_stati;
20, 2

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