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

searchwp_pdf_metadata

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)

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

Parameters

Parameter Type Description
$pdf_metadata Array

PDF metadata to index

$post_id Integer

ID of entry being indexed

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