function my_capitalize_string($content) { $content = str_replace('some string', 'SOME STRING',$content); return $content; } add_filter('the_content','my_capitalize_string'); add_filter('the_excerpt','my_capitalize_string');