How to Filter strings Content, Title and Comments WordPress

Filter and replace strings from the Title, Content and Comments automatically.

If you want to replace the output string paste this code in your functions.php file

function word_filter($content) {
$str = "QUICOTO"; //look for string
$newstr = "quicoto"; //new string
$html = str_replace($str, $newstr, $content);
return $html;
add_filter('the_title', 'word_filter',1); //Repalce the string in the Title
add_filter('the_content', 'word_filter',1); //Repalce the string in the Content
add_filter('comment_text', 'word_filter',1); //Repalce the string in the Comments

About Ricard Torres

Senior Front-end Software Engineer from Barcelona, Haidong Gumdo Instructor (korean martial art of the sword), street photographer, travel lover, TV addict, Boston Red Sox fan, and privacy advocate.

@ricard_dev @ricard_dev

📝 Blog 🎙 Podcast

Leave a Reply

Add <code> Some Code </code> by using this tags.