Created
June 24, 2020 19:29
-
-
Save jchristopher/09fda2f76ead1bd72367ca1aeeacfa9c to your computer and use it in GitHub Desktop.
Remove parsed PDF content when rebuilding SearchWP index
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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