WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a WP that has a custom theme, and all the translations working fine. Now I (i.e. my client) would like to tweak some wordpress-provided translations that live in /wp-content/languages/some_LANG.po.

Can I simply alter these files without fear of them being overwritten during an update, or should I handle this from my theme somehow?

For example I'd like to change (a bit) the messages related to password protected posts in the frontend.

share|improve this question

It is better to use a separate file to prevent an overwriting during an upgrade.

Filter load_textdomain_mofile and replace the old file with your own:

add_filter( 'load_textdomain_mofile', function( $mofile, $domain )
    if ( 'name_of_the_textdomain' === $domain )
        return 'path_to_your_file.mo';

    return $mofile;
share|improve this answer
That's what I like about WordPress, filters all over the place! – frnhr Sep 20 '13 at 18:48
and what about future additions to the mo file? For example, WP gets some new feature that has a few new translation lines. I'd have to manually add them to my file, right? No way to partially overload translations? – frnhr Sep 22 '13 at 8:47

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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