I need to find and replace text from all pages from a Wordpress site. This text shows in header as well, I tried this in functions.php but not working:
function replace_text($text) {
$text = str_replace('word1', 'word2', $text);
return $text;
}
add_filter('the_content', 'replace_text');
Anyone can help with this? Thanks