Available since: 2.6.2


View Parameters »

A number of guards have been implemented in SearchWP’s parsing and indexing of PDFs. This hook allows you to better control whether SearchWP has detected a problem in parsing PDFs by setting an upper limit as to how much of the content is white space when compared to characters.

By default if more than 5% of the content is found to be white space, the PDF is considered to be problematic and SearchWP will skip it. You can control this threshold like so:

// Allow PDFs with up to 10% white space to be indexed.
add_filter( 'searchwp_pdf_spaces_to_content_percentage', function( $percentage ) {
return 10;
} );
view raw functions.php hosted with ❤ by GitHub


Parameter Type Description
$percentage Integer

Threshold for white space percentage of overall content