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 do have prepared theme files (with __(), and _e(), etc), but they lack domain argument. There are lots of such string scattered around the theme files, editing by hand seems to be a dreadful perspective. Is there any tool to do this quickly? I remember there was a script somewhere, but I can't find it now.

share|improve this question
up vote 2 down vote accepted

Ok, I finally found what I was looking for - Marking strings in themes and plugins. And here is the actual SVN repository for tools in question.

share|improve this answer

There's no perfect solution, because your search would be pretty general. Keyboardshortcuts are a real help in such cases. Ex. Notepad++ [Ctrl] + [F] = search. Then [N] for find and [R] for replace.

Most editors offer search (that includes search&replace) across files (ex. notepad++). You could do a search for __(', take a look at the search results list (opens at the exact position with a double click) and then replace '); with ', MY_TEXTDOMAIN );

Note: Top of your functions.php should then have something like:
define( 'MY_TEXTDOMAIN', 'my_textdomain_string' );
This will hold you away from replaceing everything again, when you decide to change the textdomain string, because it's stored centrally in the Constant MY_TEXTDOMAIN.

share|improve this answer
MY_TEXTDOMAIN tip looks handy, thanks. Although I definitely remember there was some script for this. – jayarjo Mar 1 '11 at 7:44
I use the same as i wrote above for myself. Dividing it into a child- and parent-theme constant makes even more sense. – kaiser Mar 1 '11 at 14:02

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.