brooklyndesignstudio

Remove Simple Headings from Search Results (Relevanssi)

Jul 13th, 2020
618
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // Remove all Simple Headings from search results (Relevanssi)
  2. add_filter('relevanssi_pre_excerpt_content', 'rlv_trim_simple_heading_shortcodes');
  3. function rlv_trim_simple_heading_shortcodes($content) {
  4.     $content = preg_replace('/\[\/?dvmd_simple_heading.*?\]/', '', $content);
  5.     return $content;
  6. }
  7.  
  8. // Remove Divi shortcodes from search results (Relevanssi)
  9. add_filter('relevanssi_pre_excerpt_content', 'rlv_trim_divi_shortcodes');
  10. function rlv_trim_divi_shortcodes($content) {
  11.     $content = preg_replace('/\[\/?et_pb.*?\]/', '', $content);
  12.     return $content;
  13. }
RAW Paste Data