Skip to content

Instantly share code, notes, and snippets.

@jchristopher
Created June 24, 2020 19:29
Show Gist options
  • Save jchristopher/09fda2f76ead1bd72367ca1aeeacfa9c to your computer and use it in GitHub Desktop.
Save jchristopher/09fda2f76ead1bd72367ca1aeeacfa9c to your computer and use it in GitHub Desktop.
Remove parsed PDF content when rebuilding SearchWP index
<?php
// Remove parsed PDF content when rebuilding SearchWP index.
add_action( 'searchwp\index\rebuild', function() {
global $wpdb;
$wpdb->delete( $wpdb->prefix . 'postmeta', array( 'meta_key' => SEARCHWP_PREFIX . 'content' ) );
$wpdb->delete( $wpdb->prefix . 'postmeta', array( 'meta_key' => SEARCHWP_PREFIX . 'pdf_metadata' ) );
} );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment