This Documentation is for SearchWP Version 3

Available since: 2.5


View Parameters »

Note: Use of this hook will require a manual reindex

When possible, SearchWP will index metadata from PDFs. You can use this hook to modify that metadata before SearchWP indexes it. In order for SearchWP to index PDF metadata, Media must be added to an engine and PDF Metadata added to Media (which is different than Document Content)

// Modify PDF metadata before it gets indexed in SearchWP.
add_filter( 'searchwp_pdf_metadata', function( $pdf_metadata, $post_id ) {
// TODO: Modify $pdf_metadata as you see fit.
return $pdf_metadata;
}, 20, 2 );
view raw functions.php hosted with ❤ by GitHub


Parameter Type Description
$pdf_metadata Array

PDF metadata to index

$post_id Integer

ID of entry being indexed