I want to translate some website to Spanish, and the default translation in 'Settings' doesn't translate everything. I notice in the code, that where the translation doesn't work there are functions like esc_attr or esc_attr_x or ___. I understand that these functions used to translate texts, but I didn't really get how it is done exactly.

Any suggestions?


1 Answer 1


Remember to have the text domain along with the render functions (echo function). It means that, they should be:

esc_attr_e("Text needing to be translated","your_text_domain");<br>
esc_attr_x("Text needing to be translated","your_text_domain");<br>
___("Text needing to be translated","your_text_domain");

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.