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.6.2

searchwp_pdf_spaces_to_content_percentage

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:

<?php
// 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

Parameters

Parameter Type Description
$percentage Integer

Threshold for white space percentage of overall content

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