One of the Word­Press sites I recently developed uses the fant­astic ZD Mul­til­ang plu­gin for Word­Press to dis­play mul­ti­lin­gual con­tent. This is the best plu­gin I’ve found so far for this but, as usual, a couple of bugs were dis­covered after the site launched …

This first of which involves updat­ing the trans­lated con­tent: if you use IE8, it will simply wipe the data from the data­base instead of writ­ing it. Bit of a pain (espe­cially when this was dis­covered), but eas­ily fixed by not using IE! Works fine in Fire­fox, Chrome, etc.

The second revolves around the way the lan­guage con­tent is dis­tin­guished within the URL and how this inter­acts with the use of UTM codes within the querys­tring of Google Analytics-enabled links.

To try to make the site more SEO-friendly, I changed the default permalinks of the pages and posts from ?p=123 to /%category%/%postname%/ and set the lan­guage permalinks in the plu­gin set­tings. This puts the lan­guage indic­ator within the URL so that it looks like “site.com/es/category/postname”. Everything works fine until you start using querystrings.

On the most recent mar­ket­ing email, UTM codes were added to the querys­tring on all the links back to site so that click­throughs could be meas­ured. The links looked like this: “site.com/en/category/postname/?utm_campaign=XXX&utm_medium=email&utm_source=YYY&utm_content=AAA&utm_term=BBB”. Through test­ing, it was soon dis­covered that, although they worked, the lan­guage switcher on the site no longer worked! Worse, push­ing the Span­ish links to the Span­ish con­tent on the site simply didn’t work, it would just default to English.

After much pulling of hair and gnash­ing of teeth, a solu­tion was found. By simply chan­ging the link on the email back to the default permalink and put­ting the lan­guage choice in the querys­tring, everything worked fine! The links went to the cor­rect land­ing page in the cor­rect lan­guage and the nice SEO permalinks in Word­Press didn’t have to be changed.

So, instead of mak­ing your email links like this:

  • site.com/es/category/postname/?utm_campaign=XXX&utm_medium=email&utm_source=YYY&utm_content=AAA&utm_term=BBB

make them like this (mak­ing sure the page_id points to the cor­rect page of course):

  • site.com/?page_id=00&lang=es&utm_campaign=XXX&utm_medium=email&utm_source=YYY&utm_content=AAA&utm_term=BBB

Of course, this was just my solu­tion to the prob­lem. Your mileage may vary.