CMS 

How to edit Wordpress search placeholder text?

1 Replies, 56 Views

Change search placeholder text in Wordpress without plugin to any other word of my choice.
1. Create the [Moderated Word] theme. You can use this plugin ([Moderated Word]/)
2. Go to Theme File Editor
3. In functions.php file of [Moderated Word] theme, add these lines after editing the desired placeholder text “ENTER THE DESIRED PLACEHOLDER TEXT”
Code:
function search_placeholder( $text ) {
    if ( is_search() ) {
        $text = 'ENTER THE DESIRED PLACEHOLDER TEXT';
    }
    return $text;
}
add_filter( 'get_search_query', 'search_placeholder' );
4. Save the file and clear caches.