Created
October 15, 2020 04:29
-
-
Save msaari/dd449ec4da5a9044e7962c766c802ed2 to your computer and use it in GitHub Desktop.
Block Formidable Forms entries
This file contains 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 | |
// Add this to theme functions.php and rebuild the index to remove Formidable Forms entries from index | |
add_filter( 'relevanssi_indexing_restriction', 'rlv_no_formidable' ); | |
function rlv_no_formidable( $restriction ) { | |
global $wpdb; | |
$restriction['mysql'] .= " AND post.ID NOT IN (SELECT post_id FROM $wpdb->postmeta WHERE meta_key = '_wp_attached_file' AND meta_value LIKE 'formidable%' ) "; | |
$restriction['reason'] .= ' No Formidable Forms entries'; | |
return $restriction; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment