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

How can I modify month names in "Archives" in my blog? I would like to translate english month names into my mother tongue. I'm using the english version of wordpress 3.1.3

share|improve this question
How do you show the month's name in the "Archives" page? – Rilwis Jun 5 '11 at 15:33
May 2011, June 2011 etc. Just like e.g in this blog: blog.sqlauthority.com – jrara Jun 5 '11 at 17:57
No, I meant which code are you using to show month's name, not how they're shown :D – Rilwis Jun 6 '11 at 1:15
up vote 4 down vote accepted

if the translation is only for the archive widget, a filter function might work (to be added to functions.php of the theme):

add_filter('get_archives_link', 'translate_archive_month');

function translate_archive_month($list) {
  $patterns = array(
    '/January/', '/February/', '/March/', '/April/', '/May/', '/June/',
    '/July/', '/August/', '/September/', '/October/',  '/November/', '/December/'
  $replacements = array(
    'jan', 'feb', 'mar', 'apr', 'may', 'jun', 
    'jul', 'aug', 'sep', 'oct', 'nov', 'dec'
  $list = preg_replace($patterns, $replacements, $list);
return $list; 
share|improve this answer
Great, works really well! – jrara Jun 6 '11 at 5:42

Depends on your theme, but some language strings may be coded in the archives.php file. Check that and also see http://codex.wordpress.org/I18n_for_WordPress_Developers

share|improve this answer

I believe the WordPress Multilingual plugin will do this, though I have not used it.

share|improve this answer
Yes, but I don't want to change the whole language of my blog, just those month names. – jrara Jun 5 '11 at 17:57

I made a function in 'functions.php':

function mes($month) {
switch ($month) {
case 1:
    $m_es = "ene";
case 2:
    $m_es = "feb";
case 3:
    $m_es = "mar";
case 4:
    $m_es = "abr";
case 5:
    $m_es = "may";
case 6:
    $m_es = "jun";
case 7:
    $m_es = "jul";
case 8:
    $m_es = "ago";
case 9:
    $m_es = "sep";
case 10:
    $m_es = "oct";
case 11:
    $m_es = "nov";
case 12:
    $m_es = "dic";
return($m_es); }

Assigning every numeric value of the months to the translation I would like to show.

Then on my 'single.php' I just gave it some format:

<?php echo get_the_date('d') . '.' . mes(get_the_date('n')) . '.' . get_the_date('y'); ?>

It's worked for me.


share|improve this answer
Just for your information: You can save yourself some code/effort and directly return the string for each case, meaning: case 1: return "ene"; case 2: return "feb"; .... That way you don't need any variable, don't need to instantiate, don't need any break;, and thus have less code. – tfrommen Apr 18 '13 at 20:45
Excellent! thanks for the tip – Angel Gtz Apr 27 '13 at 22:57

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.