I need to amend the labels for name and email fields in the comments form in my localized (Czech) Wordpress this way:

Emailová adresa    =>  Email
Webová stránka     =>  Web

What I did is that I've opened wp-content\languages\cs_CZ.po in poEdit, located the strings and compiled the new version of cs_CZ.mo. It worked well.

However, I imagine that when a new version of Wordpress comes out and the localization team releases new version of localization files, my changes will be overwritten, right?

So the question is, how to change the localized strings in a future-proof way?

I was thinking that maybe the comments mechanism provides some hooks to replace these two labels so I could create *.po and *.mo files in my theme directory but that doesn't seem to be generally applicable. What would be better would be to create a file like cs_CZ-custom.mo which would be able to override values already defined in the main language file but I'm not sure WordPress supports that.

Any suggestions?

1 Answer 1


i think you need the gettext filter. lifted directly from the codex, here is an example:

add_filter( 'gettext', 'theme_change_comment_field_names', 20, 3 );
 * Change comment form default field names.
 * @link http://codex.wordpress.org/Plugin_API/Filter_Reference/gettext
function theme_change_comment_field_names( $translated_text, $text, $domain ) {

    if ( is_singular() ) {

        switch ( $translated_text ) {

            case 'Name' :

                $translated_text = __( 'First Name', 'theme_text_domain' );

            case 'Email' :

                $translated_text = __( 'Email Address', 'theme_text_domain' );


    return $translated_text;



Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.