Если я правильно понял, навскидку два варианта
1. functions.phpadd_filter('the_content', function($content){
// Тут регулярки
return $content;
});
2. single.phpif (have_posts()) : while (have_posts()) : the_post();
$content = get_the_content();
// Тут тоже регулярки))
ну или если используется фильтр
the_content или шорткоды, то
if (have_posts()) : while (have_posts()) : the_post();
ob_start();
the_content();
$content = ob_get_clean();
// Тут тоже регулярки))