How To Replace Words On WordPress Post
Just like all we know, WordPress is actually promising publishing platform, it is totally free and simple for you to tweak or maybe installed new themes and also plugin. Or if we have small skills in PHP Programming we are able to enhanced our WordPress more easily.
On this example from WPSnipp, we will show (blank) How you can Replace Words in your WordPress posts effortlessly.
Replace Word on WordPress Content
This tutorial need to edit your functions.php, because this code do some add_filter to make it works.
All need to do, open your functions.php and paste this code.
function replace_text_wps($text){
$replace = array(
// 'WORD TO REPLACE' => 'REPLACE WORD WITH THIS'
'wordpress' => 'wordpress',
'domain' => 'domain',
'excerpt' => 'excerpt',
'function' => 'function'
);
$text = str_replace(array_keys($replace), $replace, $text);
return $text;
}
add_filter('the_content', 'replace_text_wps');
add_filter('the_excerpt', 'replace_text_wps');
On the code above using add_filter to filter the_content and the_excerpt. So all match words will be replace with the new parameter as described. That’s is, we hope this tutorial works on you.
Thanks Kevin Chard from WP Snipp for this code
Source:
How To Replace Words On WordPress Post
http://wptricks.net/the-best-way-to-replace-words-in-your-posts/
Tags: how to replace words, replace words on wordpress, wordpress tips, wordpress trick, wordpress tutorial









