11

function remove_divi_shortcodes( $content ) {
    $content = preg_replace('/\[\/?et_pb.*?\]/', '', $content );
    return $content;
}
 /*For excerpt*/
$content =  get_the_content() ;
$content =preg_replace('/\[\/?et_pb.*?\]/', '', $content );
echo wp_trim_words($content, 30);

admin Changed status to publish July 1, 2021
Add a Comment