“the j stands for Jurisdiction”
about me | research blog | wordpress plugins | jQuery plugins

10 January, 2010

qTranslate and multilingual META tags

I use WordPress with qTranslate, but I needed to have multilingual META tags which qTranslate doesn’t support – so I wrote a plugin to do the job myself. It’s pretty basic, but I thought I would share in case anyone else needs something similar.

Plugin can be found on WordPress’ Plugin site here: qTranslate Meta at WP Plugin Directory.

For users of qTranslate META 0.9.1 and older, to make the plugin work on a “static” homepage you should change the title hook used from single_post_title to wp_title (in qtranslate-meta.php, line 29). As of version 1.0.0, you can now set this directly from the plugin’s setting page, without having to edit any PHP code.

Thanks

I’d like to thank the following people for their contributions (in chronological order):

  • Victor Berchet — Help with initial localisation; French translation
  • Benoit Gauthier — autosave bug fix
  • Filippo Pisano — Italian translation
  • Marcis G. — Belorussian translation
  • Almaz — Russian translation
  • Renate Kramer — German translation
  • Rene — Dutch translation

118 Comments »

  1. I really like qTranslate and I also use it with my blog. Today I found your plugin on my WordPress Dashboard. But as you mentioned, that it doesn’t work well with All In One SEO, I don’t know why you should use it, if you have All In One SEO installed. I do have this plugin installed and as I translate all tags using the additional language inputs qTranslate adds to the tags administration, All In One SEO will automatically use the correct language for the tags and also for the title (and the canonical META tag).

    But maybe there is something really new with your plugin I didn’t see.

    Comment by Kau-Boy — 11 January, 2010 @ 4:04 pm

  2. Hey,
    I appreciate your interest. However I’m not sure I understand what you mean.
    If I have a page which is available in multiple languages, then I want to have META keywords and META descriptions in each language. So:

    • http://site.com/en/my-page/ will have META keywords “this, is, my page”
    • http://site.com/it/my-page/ will have META keywords “questa, e, mia, pagina”

    Etc.. are you saying AIOSEO can do this?

    Comment by John — 11 January, 2010 @ 4:16 pm

  3. Yes it does. Just navigate to your Posts->Post Tags menu and click on the “edit” link of one of your tags on the right side. Than you should see “Tag Name (English)” and “Tag Name (Spanish)”. By default, qTranslate adds the main language, let’s say it’s spanish in your case, to all other languages.

    Once you have translated the tags, your done. As AIOSEO get’s it’s tags after they have been translated by qTranslate, you should see them in your source code. AIOSEO also adds a “description” meta tag with some lines of your post content.

    For an example look at this site: http://kau-boys.de/software/kostenlose-alternative-zum-cisco-vpn-client-unter-windows-7-x64-64-bit

    If you switch to the english version, you should see “operating system” instead of “betriebssystem” in the meta tag “keywords” and an english text in the “description”.

    I know it is not very comfortable to translate the tags (and categories) one-by-one trough your administration. So it would be very nice, if in a new version of qTranslate, you can add new tags in multiple languages within the “Add new” section. But I usually use acronyms for my tags, so I don’t have to translate many of them.

    I hope this tip was helpful for you.

    Comment by Kau-Boy — 11 January, 2010 @ 4:30 pm

  4. Hmm I see, I honestly never paid attention to that. It is a good approach and I’m sure many will find it an ideal alternative to my plugin. However there’s still a few issues which this does not handle:

    1. This only works for meta keywords, not for meta descriptions or any other meta fields (as far as I can tell)
    2. It is somewhat limiting on your keyword flexibility. For one thing, all your posts need to have the exact same number of keywords in each language, whereas this is not always applicable. For SEO reasons you may want to add multiple alternatives of the same word in one language (eg “flashlight”, “torch”) which is just not applicable in other languages.
    3. Lastly, my plugin also offers an option to modify the browser title per language. This may be desirable when you want the browser title to contain more detail than the page/menu title.

    Thanks again for your comments. Like I said I have no doubt that your approach may be sufficient for certain users.. but I needed a little more flexibility for my own case.

    Comment by John — 11 January, 2010 @ 4:57 pm

  5. i am using your plugin for a multilanguage site (3 languages) and even though AIOSEO can be used in multilanguage sites i find your plugin lots better simply because my customers who want multiple lingo sites cannot be expected to learn to use the langage tags. I provide the SEO capabilities (custom title and description tags per page) and they insert the key words etc.

    In my opinion it is a lot more user friendly for the customers to use your plugin because they can just insert the keywords and don’t have to worry about tags etc.

    Well done.

    Comment by Harry — 28 January, 2010 @ 1:35 pm

  6. I’m using qTranslate on a local testsite together with qTranslate Meta and had no problems to install and configure both plugins. These are really great plugins for multilang-sites, many thanks to Qian Qin and John for their effort!

    Now I wanted to run the plugins on a livesite, installed them but when trying to activate qTranslate Meta I get the following error message:

    Plugin could not be activated because it triggered a fatal error.

    Parse error: syntax error, unexpected T_NEW in /web/1/000/032/552/99242/htdocs/wp-test/wp-content/plugins/qtranslate-meta/qtranslate-meta.php on line 36

    Can someone figure out the reason for this error and give me some advice what I have to do now?
    Thanks a lot

    Comment by Heike — 1 March, 2010 @ 2:51 pm

  7. Hi Heike, thanks for your comments :)
    With regards to the error you are experiencing, please confirm that qTranslate is already activated before activating qTranslate META.

    Comment by John — 1 March, 2010 @ 3:07 pm

  8. Thanks for your reply, John. Of course I activated qTranslate first.
    I also checked the usual things that may cause trouble (no SEO-Plugin installed), updated wordpress to the latest version (2.9.2) and used also the latest versions of qTranslate (2.5.6) and qTranslate Meta (0.7.1).

    On the local environement everything works fine, so I have no idea what’s going wrong with the livesite – maybe the database is buggy.
    I’ll give it another try tomorrow by setting up everything with a new database on the server and let you know when I had success.

    Comment by Heike — 1 March, 2010 @ 7:34 pm

  9. Heike, I doubt this is a database issue, but rather something to do with different PHP settings on your server. This should temporarily fix your problem though:
    Simply comment out line 36 of qtranslate-meta.php (It is not part of the plugin functionality anyway).
    If it still complains, simply replace line 36 with:
    die();

    I will try to fix this properly in a future update. Perhaps you could send me a dump of your phpinfo by email?

    John

    Comment by John — 1 March, 2010 @ 9:17 pm

  10. After some looking around, I suspect your live server is using PHP version 4.x – can you please check this and let me know?

    John

    Comment by John — 1 March, 2010 @ 9:39 pm

  11. *taking my hat off to John*
    PHP 4 was the culprit. After changing to PHP 5 everything runs like clockwork :-)
    Thank you very much

    Comment by Heike — 2 March, 2010 @ 11:25 am

  12. A question. Can the keywords entered in the Multilingual META window be used to generate some tags list? I am thinking of tagging WP pages (vs WP posts that already have tags widgets) in order to be able to produce lists of pages (and of posts also, why not) dealing with a particular subject described by a specific keyword.

    Comment by Diana — 6 March, 2010 @ 10:41 pm

  13. Hi Diana
    No, currently the META tags cannot be used as WordPress post tags and to be honest I don’t have any plans to implement them as so.
    However if someone wants to add this feature themselves I would gladly consider adding it to the plugin.

    Comment by John — 7 March, 2010 @ 10:54 am

  14. just curios: do you have any experiences with qtranslate and mailpress? mailpress.org is a great newsletter plugin, but I am having trouble with it as the newsletter language tags do not get “translated” i.e. the newsletter subject looks like this: This week at Quilombo even if I don’t send out a newsletter in multiple languages as the newsletter editor automatically creates the multiple language tabs :-(

    If you can be of help with this problem, please get back to me otherwise, sorry to have bothered you. I’d be willing to donate for a solution.

    Comment by ovidiu — 9 March, 2010 @ 1:41 pm

  15. Hey there
    Yes actually I do use MailPress together with qTranslate. The way I handled this was basically creating my own MailPress theme (by copying one of the default ones) and then modifying it to my needs. Apart from aesthetics, this in particular involved using the localisation functions __($myvar) to ensure that the qTranslate tags were correctly handled.
    I know this is not an ideal solution in that it does require quite a bit of work. In addition, a word of warning: keep backups of whatever MailPress themes you create, as auto-updating the plugin will erase any custom themes.

    Comment by John — 9 March, 2010 @ 2:26 pm

  16. Hi John,

    Thanks for the nice plugin! I researched the whole SEO / META -matter for a whole day, comparing your plugin to “All in One SEO Pack” as well to “Platinum SEO Pack” (which is supposed to be more compatible with qtranslate than All in 1 SEO pack), but in the end I came to the conclusion that there’s actually nothing in regards of SEO and META that your plugin wouldn’t offer – in other words – it’s the best choice for someone who uses qtranslate.

    The only thing I perhaps would like to see is a “noarchive” option for some pages, but that’s only a minor setback.. in fact so minor that I’m wondering why on earth do you answer the question:

    “Why does it not work with AIOSEO / other SEO plugins?”

    .. with:
    “Yes, I know this is a major drawback.”

    I see hardly any drawbacks. Or are there really some which I haven’t thought about?

    Comment by Milan Kolarovic — 11 March, 2010 @ 5:43 pm

  17. Hey Milan,
    Thanks for the kind words :)
    Well to be perfectly honest, I answered that way because I never really analysed the full extent of the AIOSEO’s abilities. In other words, I know there’s a bunch of other SEO considerations out there, but my plugin really only tackles one particular thing; so if someone is looking for some total SEO solution they might find it limiting that my plugin won’t necessarily work with other WordPress plugins…
    But yes, maybe “major drawback” is an over-statement, I think I’ll actually change it ;)
    PS If you like the plugin, I would appreciate it if you would rate it in the WordPress Plugins Directory.

    Thanks!

    Comment by John — 11 March, 2010 @ 7:03 pm

  18. Hi John,

    Your wish has been granted, and I’ve actually rated all the plugins I’m using + reported on the compatibilities :)

    Comment by Milan Kolarovic — 15 March, 2010 @ 4:19 am

  19. @John:

    great, maybe you can help me out? The problem I pasted above got cut out. The issue is that the subject of my newsletters doesn’t get translated. It looks like this:

    How would I need to edit the mailpress template so that the subject gets properly translated without those ugly brackets?

    Comment by Ovidiu — 15 March, 2010 @ 11:45 am

  20. oh, no, my code got edited out again. can you show me an example of how your subject gets generated inside your mailpress theme? if you consider it offtopic feel free to email me.

    Comment by Ovidiu — 15 March, 2010 @ 11:46 am

  21. Generally, all you need to do is make sure that whenever your are outputting text you need to use the __() and _e() functions.
    So, for example: <?php echo $post->title ?>
    would become: <?php echo __($post->title) ?>
    or more simply: <?php _e($post->title) ?>

    If you want more help would be best to email me directly.

    Comment by John — 15 March, 2010 @ 5:57 pm

  22. Hi, this is a great plug-in thank you. I’ve been using it in a couple of websites already. Although I’ve installed and correctly manage to make it work (no much about it as it’s quite easy), I came up with a website where I can’t change titles. Don’t really know why it doesn’t work.

    This is my current title code:
    <title><?php if (is_home () ) { bloginfo(‘name’); } elseif (is_single() ) { single_post_title();} elseif (is_page() ) { single_post_title();} else { wp_title(‘’,true); } ?></title>

    Translate Meta tags doesn’t recognize this so nothing comes up on the titles. Can you please help me out with this, thank you and greetings from Sahara Desert.

    Comment by João Leitão — 25 March, 2010 @ 11:03 am

  23. Hi João,
    I’m not quite sure what you mean.
    That code you pasted is from your template file, correct?
    Now what exactly are you trying to enter in the qTranslate META Edit Page box, and what actually is the title being set to when loading the page? (Use View Source)

    John

    Comment by John — 25 March, 2010 @ 11:30 am

  24. Hey, thank you for your quick response. Yes, that is my code from the template file. What I get in the title, is the normal page name and not the text I actually entered on the meta qtranslate boxes for the 3 languages. you can check it for yourself http://www.darrita.com/ (only the location and homepage have qtranslate tags). Actually I’m noticing the code, and, both keywords and description are there but, title still missing though.

    Also, could you possible know how do i add image flags to the drop down menu (i want both image + text) if possible.

    thank you for the help. Cheers.

    Comment by João Leitão — 25 March, 2010 @ 1:58 pm

  25. Hi again
    The reason for this is that the plugin only alters the text generated by wp_title(), however your template is not always calling this function.
    One thing you could try, is adding this line to the constructor of the plugin (qtranslate-meta.php, line 29-30):
    add_filter('single_post_title', array(&$this, 'hook_title'));
    I don’t know if it will work, but it’s worth a try… Let me know.

    Comment by John — 25 March, 2010 @ 2:19 pm

  26. HEY WOW it works perfectly now! Thank you so much, I’m just now starting that website, I can go on now. Anything you need just say so, Cheers!

    Comment by João Leitão — 25 March, 2010 @ 7:55 pm

  27. I think that you should check this http://alexking.org/blog/2008/09/06/wordpress-26x-duplicate-custom-field-issue

    Comment by Yordan — 30 March, 2010 @ 4:35 pm

  28. Hi, thanks for the plugin. I’m having trouble with my meta information being deleted. If I leave my page open, the save_post hook will trigger for revisions and I will loose my meta information.

    I added this line in your hook_save_post function

    $revisionID = wp_is_post_revision($post_id);
    if ($revisionID === false || $revisionID === $post_id ) {
    ... Your save code
    }

    This seems to cure my problem.

    Comment by Benoit Gauthier — 30 March, 2010 @ 6:10 pm

  29. Hi Benoit,
    Thanks for your input. I personally have auto-save turned off because it seems to cause some other problems with qTranslate (only some of the time) and kind of annoys me in general. I have pushed your changes into a new version (0.8), would you kindly update and confirm the issue is now fixed for you?

    Thanks
    John

    Comment by John — 30 March, 2010 @ 6:22 pm

  30. [...] questo caso è necessario installare un ulteriore plugin, chiamato qTranslate Multilingual META, che appoggiandosi a qTranslate ci permette di tradurre anche i Meta [...]

    Pingback by Come rendere WordPress multilingua | Realizzazione siti web a Palermo e Agrigento - kifulab — 2 April, 2010 @ 11:11 pm

  31. @John:

    coming back to your comment #21 I understand what you explained, but I am unsure which template file contains the part of the subject.

    The only untranslated part I need to take care of is the subject of the newsletter people are getting.

    I know there are loads of templates, but I guess I use the default.

    I simply go to new mail in the mailpress menu, then send the mail to all recepients.

    Comment by ovidiu — 7 April, 2010 @ 5:33 pm

  32. Hmm to be honest I don’t think I’ve had that problem myself (with the email subject). I had customised a theme but can’t see that I’ve made any modifications anywhere else in the plugin…

    Comment by John — 8 April, 2010 @ 8:56 am

  33. I am not sure where to find that text. my email subjects all look like this:

    This week at Quilombo

    I hope it doesn’t get filtered. I have inserted extra spaces to avoid it being filtered.

    Comment by Ovidiu — 8 April, 2010 @ 5:45 pm

  34. ok, it got filtered, here it is: http://pastebin.com/raw.php?i=ZTXdBKBz

    Comment by Ovidiu — 8 April, 2010 @ 5:46 pm

  35. hi. i am using this plugin and i think it is awesome. only one thing – when the browser title is retrieved after it is placed the blog title. but i nmy case there is no space between them. so it looks sometimg like this:
    Wine – Red, White and Rose Wines – Wholesale Bulgarian Wines有个性的红酒 | Wine with Character

    how and where to add a single space between wines and the start of the chinese characters?

    Comment by david — 15 May, 2010 @ 10:42 am

  36. Hi David
    This is usually very simple, in the qTranslate META settings page just insert the extra space yourself in the Title suffix box, such as: " | my suffix" (note there is an initial space).
    Does this work or have I mis-understood your question?

    Comment by John — 15 May, 2010 @ 11:55 am

  37. Hi John, thank you for this awesome translation plugin!
    qTransalte works great for me! But unfortunately I can not get qTranslate META run. Nothing appears in the code of my site.
    Can you give me a hint what I might do wrong? This is the website I am using your plugins for: http://janfehlis.de
    Thanks for any help! Jan

    Comment by Jan — 17 May, 2010 @ 2:28 pm

  38. Hi Jan
    First of all I am not the author of qTranslate :)
    Secondly, qTranslate META adds a new box to the “add/edit post” page – write a new post and scroll down underneath the text editing section, you should find the options there!

    Comment by John — 17 May, 2010 @ 7:06 pm

  39. Thank you John! Somehow I assumed you are the author. :)

    I found the options but cannot see any changes in the source code of my homepage. I just checked on a post and there the meta appears. Maybe it does not work on the homepage?

    Comment by Jan — 21 May, 2010 @ 2:21 am

  40. Hi Jan
    May I ask, go to Settings → Reading in WordPress and let me know what the Front page displays setting is set to. I suspect in your case it is set to Your latest posts, in which case qTranslate META will have no effect since the META tags are saved per post, and do not apply to these “aggregate” pages.

    John

    Comment by John — 21 May, 2010 @ 11:07 am

  41. no, for me does not work. when i try to save, the initial spaec disappears. same happens when i change with initial space in wordpress blog title. any other suggestions?

    Comment by david — 22 May, 2010 @ 2:44 pm

  42. @david
    Hmm interesting, this has never been an issue for me.
    Try using the non-breaking space like so:

    "&nbsp;| my suffix"

    Comment by John — 22 May, 2010 @ 2:49 pm

  43. @John

    Yes, you are right! : ) Thank you!
    Unfortunately my template has settings for the front page and blog (news), so when i change the ‘reading’ settings my slider disappears.
    Do you think there might be a way to hard code the META tags on the front page?

    Comment by Jan — 22 May, 2010 @ 3:53 pm

  44. @Jan
    For this you will need to either:

    1. Edit your template file used for the front page, putting the META tags directly in the HTML. Finding the write file to edit is not always easy or possible.
    2. Extend your template with your own functions.php file (or write your own plugin), write a function hook for wp_head and use the is_front() function to echo your META tag strings only on the front page of your site

    Neither are particularly straightforward unfortunately!
    Maybe a plugin exists which already gives this functionality?

    Comment by John — 22 May, 2010 @ 4:00 pm

  45. wow. that worked. thanks man. keep up the great work. !

    Comment by david — 22 May, 2010 @ 6:03 pm

  46. Just noticed all my keywords/descriptions have disappeared !?
    can’t rememebr doing anything relate on this site….

    weird: http://screencast.com/t/OGQ4MWNmZD
    but in the custom fields they seem to be showing: http://screencast.com/t/OGQ4MWNmZD

    any idea what happened?

    Comment by Ovidiu — 27 May, 2010 @ 6:59 pm

  47. one more: talking about this site: http://www.quilombobrasil.com/ I have set (I think with your help) the keywords and descripotion for the homepage like this in my functions.php: http://pastebin.com/xTia3m9n is there anything wrong with it as its not showing on the homepage?

    in the hybrid options, I have checked that I do have a SEO plugin, should I uncheck it?

    Comment by Ovidiu — 27 May, 2010 @ 7:30 pm

  48. ok, I unchecked that box, and now the stuff from my functions.php gets displayed but both languages :-( looks like this:

    <meta name="keywords" content="Ingles, africa do sul, cape town, cidade do cabo, south africa, intercambio, aulas de ingles, passeios, turismo, feijoada, restaurante brasileiro, comida brasileiroBrazilian, food, dance, music, cape town, south africa, English course, english classes, brasil, brazil, tours, tourism, exchange program, exchange
    programme, brazilian food, brazilian restaurant” />

    Comment by Ovidiu — 27 May, 2010 @ 7:33 pm

  49. @ovidiu
    That code you pasted will not work, because whatever you write there is not getting passed through qTranslate.
    You would need to explicitly call the qTranslate functions, something like this:

    if (exists_function('qtrans_getLanguage')) {
        $lang = qtrans_getLanguage();
        switch ($lang) {
            case 'en': $keywords = "my,english,keywords"; break;
            case 'it': $keywords = "my,italian,keywords"; break;
        }
    } else {
        $keywords = "my,generic,keywords";
    }

    Hope that helps.

    Comment by John — 27 May, 2010 @ 9:09 pm

  50. thanks. worked half-way, would you mind helping me out a little further?
    I figured out exists_function is actually function_exists, so here is my next try, but I only tried wraping your suggestion around my keywords output, left the description as it was for now. here is the new version: http://pastebin.com/2621hZFL

    unfortunately this version doesn’t output anything :-( for any of the two languages… no errors either in my log files.

    Comment by Ovidiu — 27 May, 2010 @ 11:39 pm

  51. no idea what I am doing wrong. here is my last try and all it does is print the right keywords out, depending on the laguage, but no into a meta tag, it simply pritns them out: http://pastebin.com/5eL3jcSc

    Comment by Ovidiu — 27 May, 2010 @ 11:52 pm

  52. @ovidiu
    very simple, just change line 72 to:

    return '<meta name="keywords" content="'.$keywords.'" />';

    Also to be safe you would want to wrap $keywords with addslashes()

    Comment by John — 28 May, 2010 @ 12:44 pm

  53. I will try that, but meanwhile I am wondering, why my very first try, was printing the meta keywords/description properly into the meta tags but not fitlering them by language. the code was this:

    function my_meta_description( $description ) {
    if ( is_home() )
    $description = ”;
    return $description;
    }

    and it was doing the job right but printing both languages – any idea about that?

    I can

    Comment by Ovidiu — 28 May, 2010 @ 1:39 pm

  54. It seems you had a number of different issues on top of each other and I’m no longer sure what your problem is and what you are trying to accomplish.
    Things to check are:

    1. Either return just the keywords or the entire meta string (as per my last example); just see whichever works.
    2. Trying is_front_page() instead of is_home()
    3. Trying a different hook, such as the wp_head action
    4. Changing the priority of your function hook, e.g. add_filter( 'hybrid_meta_keywords', 'my_meta_keywords', 100);

    Other than that I don’t know if I can be of much more help, these things often take some playing about to get right.

    Comment by John — 28 May, 2010 @ 2:15 pm

  55. there were indeed two problems:

    a) showing keywords7description on the front page, solved with your help.
    b) STILL ongoing problem: the keywords/descriptions I entered on posts/pages have disappeared. it looks weird, the aggregated ones for multiple languages are still there, but not the individual ones for each language, see screen shot: http://www.screencast.com/users/ovizii/folders/Jing/media/e656a44d-603b-4f21-85fe-d32a4a221fee but in the custom fields they were showing!? who could that have happened?

    Comment by Ovidiu — 29 May, 2010 @ 4:25 pm

  56. Well unfortunately with regards to your second problem it’s difficult to tell what’s going on; I suspect it was because you had Hybrid’s SEO setting turn on which somehow messed things up. I’m not sure what you mean by the “aggregated ones”, but you can check if the fields are still there or not but running an SQL query something like this:

    SELECT p.`ID`, p.`post_title`, pm.`meta_key`, pm.`meta_value`
    FROM wp_postmeta pm
    LEFT JOIN wp_posts p ON p.`ID` = pm.`post_id`
    WHERE pm.`meta_key` LIKE 'qtrans_meta:%'

    See if in the meta_value column your keywords and descriptions are still there, in qTranslate form, e.g:

    <!--:en-->hello<!--:--><!--:it-->ciao<!--:-->
    etc.

    If not then you will probably need to enter them again manually… Like I said I cannot really say what’s happening, this is just a best-effort approach.

    Comment by John — 29 May, 2010 @ 4:49 pm

  57. Hallo, danke f

    Comment by Choko — 12 June, 2010 @ 2:12 pm

  58. hi john! great plugin, thank you for that!!

    unfortunaltely I discovered some troubles after activating the plugin in wordpress 3. when the plugin is activated, I sometimes have troubles with viewing the admin panel, e.g. the plugin page wont display, it stays empty. on macos it happens only sometimes, other users on a windows machine can’t see most of the admin pages. I am not sure if it is the plugin or some other issue, but it started after i installed it.

    versions:
    wordpress 3
    qtranslate Meta Version 0.8.5
    qtranslate Version 2.5.8

    thanx in advance for your help!

    Comment by muffalin — 23 July, 2010 @ 12:44 am

  59. Hey.. sorry to hear you’re having troubles. I’ll be honest, I haven’t really tested the plugin with that latest versions of WordPress and qTranslate. Can you see if you are getting any Javascript errors (e.g. using Firebug)?
    Do you have any issues with viewing the frontend of the site?

    Comment by John — 24 July, 2010 @ 11:48 am

  60. Hi!

    I have a small problem, when I enter the title of the page I want in the “Browser Title:” for my page, it results into creating a title for the page that adds the name of the blog after the title I have written. How can I make it so that the title that is created is ONLY the phrase that I enter in the “Browser Title:”.

    Thanks in advance!

    Comment by Maria — 26 July, 2010 @ 5:04 pm

  61. Hi Maria,
    Try checking Tools -> qTranslate META and set the title suffix to blank, or alternatively if that doesn’t work try “&nbsp;”

    Comment by John — 26 July, 2010 @ 7:29 pm

  62. I’m having the same troubles of muffalin
    I look forward the wordpress 3 compatibility

    thanks

    Comment by banane — 27 August, 2010 @ 9:56 pm

  63. @banane
    I have clean install of WordPress 3.0.1, qTranslate 2.5.9 and qTranslate META 0.8.5 and cannot reproduce the problem. I’m sorry but this must be a conflict with another plugin. If you submit any bug fixes I will gladly incorporate them but other than that I cannot really help with the info you’ve given me.

    As I said, everything seems to work on WordPress 3 (I finally tested it).

    Comment by John — 28 August, 2010 @ 12:25 pm

  64. When I click on meta summary or qtranslate meta settings I just see the page reloading (clean install of WordPress 3.0.1, qTranslate 2.5.9 and qTranslate META 0.8.5) If I enable debugging I see: has_cap was called with an argument that is deprecated… no more
    Anyway, thank you for your effort

    Comment by banane — 28 August, 2010 @ 2:45 pm

  65. Hmm that does help actually, I believe I may have fixed the issue.
    Kindly update to version 0.9 and let me know if you are still experiencing the same problem.

    Comment by John — 29 August, 2010 @ 2:39 am

  66. ok, now I can see the setting page and the meta summary. there is a little bit of confusion with the page titles: the home page and category pages have the title of the last post and all the page titles have the blog name as suffix (if I set the title suffix it doesn’t replace the blog name but it is added before it).
    Enabling debugging I have: Notice: Trying to get property of non-object in wp-includes/capabilities.php on line 901, 906, 924 and 926 Notice: Undefined variable: _SESSION in /wp-content/plugins/qtranslate-meta/summary-page.php on line 17 and 21 then Notice: Undefined index: qtrans_meta_convert in wp-content/plugins/qtranslate-meta/settings-page.php on line 6
    Thanks very much

    Comment by banane — 29 August, 2010 @ 7:20 am

  67. Updated to version 0.9.1, please see below:

    the home page and category pages have the title of the last post

    Fixed.

    all the page titles have the blog name as suffix

    This depends on your theme, qTranslate META can only control what comes out of the wp_title function — there may be other stuff hardcoded in betweent your <title> tags.

    Comment by John — 29 August, 2010 @ 9:18 am

  68. great! it’s working
    I’ll fix my theme later
    thank you, again

    Comment by banane — 29 August, 2010 @ 11:02 am

  69. I am running the latest version of wordpress, qtranslate and qtranslate meta.

    Before installing qtranslate meta I was unable to change the meta title tags, of the home page and blog page, into the second language (Thai). So I installed qtranslate meta and set the new titles in the boxes provided. However there has been no change in the titles.

    Do you know what I need to do to make it work?

    This is the Thai version of the home page.
    http://bit.ly/cxAgZO

    This is the about page with the titles correctly translated
    http://bit.ly/dBbIrZ

    thanks

    Note: I did post a comment a few days ago but it didnt show up here, so sorry if you already have this.

    Comment by David — 3 September, 2010 @ 11:25 am

  70. Hi David,
    No I did not get your first comment, thanks for re-posting.
    What happens when you set the META keywords/description? Do those work correctly?
    It’s difficult for me to be able to determine why the title isn’t being changed, but generally this is a theme issue. Specifically, qTranslate META attaches to the single_post_title filter hook, and this may not be getting called in your theme (e.g. via the WordPress function wp_title()).

    Comment by John — 4 September, 2010 @ 11:07 am

  71. Hi

    I have added meta keywords and description for the news/blog page here
    http://bit.ly/aUV28t

    But if you check the source code there is no sign of the Thai meta title, keywords or description.

    In the short term I really need to get the Thai title onto the Thai homepage here
    http://bit.ly/cxAgZO

    Is there a work around or other way I can do it?

    The site runs the Thesis theme and I use Thesis openhook – is there a hook I can use to do this?

    Hope you can help

    Thanks

    David

    Comment by David — 6 September, 2010 @ 6:52 am

  72. Have you checked to see that you have localised the Site Title (in Settings → General)?
    You would need to set it as something like this (using the qTranslate QuickTags syntax):

    [:en]English Title[:it]Titolo Italiano

    etc.

    Comment by John — 7 September, 2010 @ 10:24 am

  73. Hi John! I have two little problems here.

    1) Thing is that I have a visible text on my page where i want to place ‘Description’ for every page. So the plugin works well, it prints different description for every language in my meta tags, but when I’m trying to duplicate the same description on the page it prints me general blog description all the time (“Just another wordpress site”). The code which I use is:

    2) I also made a visible field on every page for a page title. It works everywhere excluding the Main page. On the main page it shows nothing. The code is:

    Hope you will answer soon! Thank you for the such a great plugin!

    Comment by Jury — 11 September, 2010 @ 10:14 am

  74. Sorry! Totally forget about hiding php tags. So the codes are:

    1) echo get_bloginfo( ‘description’, ‘display’ );

    2) echo wp_title( ”, true, ‘right’ );

    Comment by Jury — 11 September, 2010 @ 10:16 am

  75. Hi Justin, sorry for not replying earlier but I didn’t see the comment until now.

    1. That isn’t really within the scope of the plugin, and you should really consult the qTranslate guide. However as a hint, you should be able to achieve it with something along these lines (note you’ll need to get hold of the post_id):

      _e( get_post_meta($post_id, 'qtrans_meta:description', true) );

    2. This is probably because your front page contains multiple posts, therefore there is no single post from where it can get the title.

    Comment by John — 20 September, 2010 @ 7:41 pm

  76. is there a way to set title and description for categories and custom taxonomies?
    thanks!

    Comment by banane — 28 December, 2010 @ 10:39 pm

  77. No there is currently no support for custom taxonomies, sorry! Maybe someone would like to add it themselves…

    Comment by John — 30 December, 2010 @ 9:56 am

  78. hey there. sorry to disturb i see you have enough reading material.. i was just wandering.. i’ve made some custom tags and i get the option ita/eng in the boxes from dashboard but i don’t get where everything gets saved…
    by the way thanks for the plugin. it’s awseme!! saved me so much headache

    Comment by andrew — 4 January, 2011 @ 4:32 am

  79. In my blog the home page still have the title and description of the last post. Indeed, I do not know how to manage the description for the home page … Will you please help me?

    Comment by Agnese — 22 January, 2011 @ 12:39 pm

  80. Sorry but the plugin does not directly support home pages which contain a summary of the msot recent posts.
    One way of achieving this would be to change Settings → Reading → “Front page displays” to static WordPress page, which uses a custom template to load the most recent posts (essentially emulating the default WordPress functionality). The advantage of this is that you will then be able to specify the qTranslate META stuff as usual by using the Wordress page editor.

    Hope that helps. Unfortunately I don’t have the time to update and test the plugin, but if someone wants to try I will gladly include their changes in an updated version.

    Comment by John — 23 January, 2011 @ 12:43 am

  81. After all, AIOSEO works perfectly using tags [:en]… [:it]… in the variuous fields (keywords, description, etc). Thank you!

    Comment by Agnese — 27 January, 2011 @ 6:30 pm

  82. hi,many thanx to ur plugin. just want to ask how can i disable meta description on index page? i tried but no result. thanx again and waiting for ur answer.

    Comment by charley — 20 April, 2011 @ 7:07 am

  83. Hi Charley
    Sorry but there’s no way of doing this in the current version of the plugin.
    If you’re willing to get your hands dirty, try editing the hook_head function in qtranslate-meta.php (line 158) yourself by adding something like this:

    if (is_home()) return;

    Refer: http://codex.wordpress.org/Function_Reference/is_home

    Hope that helps!

    Comment by John — 22 April, 2011 @ 7:37 am

  84. anyway, thanx John ;) I’ll try out other way ;)

    Comment by charley — 20 May, 2011 @ 4:25 pm

  85. I figure how to have a custom meta description on the home page
    and use the plugin for the other pages and posts.

    paste this code in the header.php

    if ( is_home() ) {
    _e("<meta name=\"description\" content=\"description francaisenglish description\"/>");
    } else {
    /*use qtranslatemeta */
    }

    Comment by Francis Perron — 5 August, 2011 @ 9:34 pm

  86. Hi there,

    I’m making this website that is in both English and Chinese. In the Multilingual META box when you edit a post:

    I can no longer edit ‘English’ part in it. If I click on the Chinese part, it appears I can edit it. Please help as soon as you can.

    Apologies if this has been dealt with above. Many thanks and hope you are having a good day!

    This is a screenshot of what I am pointing at:
    http://i.imgur.com/jqqxb.png

    Thanks,

    James

    Comment by James — 31 August, 2011 @ 4:17 pm

  87. Hi John,
    This plugin is excellent. I need to update a WP installation to 3.2.1 but the compatibility is not yet checked in the plugin profile over at WP.org
    Is it already compatible?
    Thanks in advance

    Comment by facundo — 18 October, 2011 @ 11:33 am

  88. Yes it should work, I just haven’t updated the plugin readme in a while!

    Comment by John — 18 October, 2011 @ 11:36 am

  89. Thanks John. Will report problems if any once I do it. Cheers

    Comment by facundo — 19 October, 2011 @ 5:01 pm

  90. Hi, a very useful plugin for a multilingual sites. Thank you.
    Browser title only works with pages which are (is) not dedicated as wp home page (Reading Settings-Front page displays)?
    Can I tweak this somehow?

    Comment by Jurij — 25 October, 2011 @ 9:16 am

  91. Hi Jurij, yes you should be able to change the title hook used from single_post_title to wp_title (in qtranslate-meta.php, line 29).
    John

    Comment by John — 25 October, 2011 @ 9:22 am

  92. Thank you John, it works.
    In addition I have to add  |  to the end of every `Browser title` box in a plugin widget.
    … and I have just rate a plugin, to thank you somehow.

    Comment by Jurij — 25 October, 2011 @ 11:27 am

  93. Thank you very much for this plugin.

    Comment by Marian — 5 November, 2011 @ 6:55 pm

  94. I used this plug-in on a website, had all the data entered, updated the website and now the data’s missing completely. Is this a known issue? Do I have to safe all the entries in the description and keyword fields before updating the plug-in? I’m quite annoyed about this problem to be perfectly honest and didn’t expect the plug-in to cause this issue.
    Other than that, I was happy with it. But this is a huge upset for me as it generates a lot of unnecessary extra work.

    Comment by soulwarrior — 28 December, 2011 @ 2:54 pm

  95. Sorry to hear about your bad luck… you really should make a backup before you update WordPress (I don’t know why that feature isn’t built-in).
    I have never heard of this issue, though. Most likely it is due to WordPress updating your posts’ custom fields, rather than something the plugin has done itself. You might want to dig around in your database as it’s possible your meta data is still there. Look in the wp_postmeta table, for fields that being with qtrans_meta:

    Comment by John — 28 December, 2011 @ 3:12 pm

  96. I think this plugin is awesome! At first, I had the same problem as soulwarrior, but luckily I DID make a backup. After installing it again it worked fine. Thanks again!

    Comment by heftruck cursus — 30 December, 2011 @ 4:58 pm

  97. Hello,

    your plugin is brilliant, but i still have 2 problems :
    - the most important one, is that i did set a “static” homepage, but even this way there are NO titles or meta description on my homepage. It is very important so… how may i fix this?
    - the other problem is that there are no field to customize title/ meta descriptions in Porfolios.. which i am using.

    Any way to change that? The homepage being extremely important.. and i dont want to put it in the “settings” which makes that it will be available on all the pages!

    Thanks a lot for that plugin!

    Comment by herbertwest — 7 January, 2012 @ 8:28 pm

  98. Hi Herbert,

    1. Have you tried changing the title hook used from single_post_title to wp_title (in qtranslate-meta.php, line 29)
    2. I don’t know what “Portfolios” you are referring to…

    John

    Comment by John — 7 January, 2012 @ 8:44 pm

  99. Hi John, thanks a lot for your quick feedback! I will try this within an hour or two.

    Regarding the portfolio that i am talking about, it’s in wordpress. I can add POSTS, SLIDER, PORTFOLIOS, TESTIMONIAL, LINKS, PAGES.
    On the website i am currently working on, i am mostly using : PAGES + PORTFOLIOS.. and i cant customise the titles of Portfolios? (there are no title box)

    See the pictures below (imageshack):
    http://imageshack.us/photo/my-images/861/portfolios.jpg/
    http://imageshack.us/photo/my-images/684/portfolios2.jpg/

    Comment by herbertwest — 9 January, 2012 @ 12:35 pm

  100. Those post types must be provided by some WordPress theme or plugin; they are not part of “standard” WordPress. The plugin isn’t very complicated and could probably be easily extended to include these post types, however you will have to investigate this yourself.

    Comment by John — 9 January, 2012 @ 12:43 pm

  101. Yes! I now have a title on the homepage, which is quite important ! Thanks a lot!

    Regarding the porfolio, it must have been added by the theme that i am using : perfekto
    i’ll to find a way. Thanks again !

    Comment by herbertwest — 9 January, 2012 @ 1:34 pm

  102. Hello,
    Also I use WordPress with qTranslate and I think this plugin it is awesome.
    I need to find how to enable the qTranslate QuickTags as:
    [:en]John[:es]Juan or also <!--:en-->John<!--:--><!--:es-->Juan<!--:-->
    in my Comments area. Does anyone know how to do this?
    I can’t figure out why they don’t work. Probably need some extra code in my templates files (Magazine-Basic). I thought that these QuickTags were good to get separate comments for each language, and I don’t understand why they are not able to do it. I tried to put the QuickTag in my comments area, above the content but they didn’t work.
    Please can someone help me figure out how to enable this for each comment?

    Comment by Helga — 11 February, 2012 @ 2:55 am

  103. Hi Helga,
    You will likely need to edit some PHP in your template to get that working. It might be as simple as passing your comment text through the _ẹ() function, or you might need something more manual like this:

    if (!function_exists('qtrans_getLanguage')) {
    $lang = qtrans_getLanguage();
    $translations = qtrans_split( $comment );
    echo $translations[$lang];
    }

    I guess this should be implemented as a filter on the comments, e.g. using the comment_text filter hook. You can find the documentation for the qTranslate functions here.
    Hope that helps!

    Comment by John — 13 February, 2012 @ 10:08 am

  104. Hi John,
    just installed your plugin and have the following problem, using
    Theme Twenty Ten 1.2
    qtranslate 2.5.24
    qtranslate META 0.9.1

    The title does not change with the language and I don’t know how to do this.
    I had installed before All in one SEO, but deactivated it, before installing qtranslate META.

    I read the whole thread, but couldn’t find anything. As well I changed the line 29 into wp_title,
    but still get the same result, the title only changes from …../blog/title to …../blog/es/title or …..blog/de/title,
    but not changing the title by itself.

    As I am new to this whole internet marketing stuff, maybe this is a stupid question, but even though would apreciate some info.
    Oh yes, site is set to begin with static page and I see a permalink(but if I change this permalink i can’t see anything)

    Thanks in advance

    Olaf

    Comment by Olaf — 6 March, 2012 @ 11:38 am

  105. Hi,
    Is it possible to please tell us which code to hook in the functions.php or wherever in order to make this work with custom post types & taxonomies?
    The tragedy is that qtranslate itself supports them out of the box, your plugin unfortunatelly NOT! (and as you see, the issues comes up again & in the above comments).
    Telling us we should investigate it ourselves is cute, but unfortunatelly useless :-(
    If we were programmers, guess we wouldn’t have needed a plugin in 1st place, so your feedback, as developer of this plugin is crucial.

    Thanks!

    Comment by candy — 5 May, 2012 @ 4:06 pm

  106. OK, foundt it :) – bless these guys here:
    http://tonykwon.com/2010/07/09/how-to-enable-qtranslate-meta-on-custom-post-types/

    So if you need to apply multilingual meta-tags to your custom post-types, add this to your functions.php :

    if ( is_admin() && function_exists(“qtrans_getSortedLanguages”) ) {
    add_action(‘admin_menu’, ‘enable_qTranslate_Meta’);
    }
    function enable_qTranslate_Meta()
    {
    global $qtransMETA;

    $post_types = get_post_types();
    /* post and page types are already processed by the plugin */
    $disabled_types = array( ‘post’, ‘page’, ‘attachment’, ‘revision’, ‘nav_menu_item’ );
    $enabled_types = array_diff( $post_types, $disabled_types );

    if ( $enabled_types ) {
    foreach( $enabled_types as $enabled_type ) {
    add_meta_box(
    ‘qtrans_meta_meta_box’, //HTML id
    __(‘Multilingual META’, ‘qtranslate-meta’), //title
    array(&$qtransMETA, ‘meta_box_generate’), //callback
    $enabled_type, //type
    ‘normal’, //context – normal, advanced, side
    ‘high’ //priority – high, low
    );
    }
    }
    }

    Good luck :)

    Comment by candy — 5 May, 2012 @ 4:15 pm

  107. qTranslate META does not change “Title” tag for a static front page! It’s just empty :(

    Comment by Ruslan — 2 June, 2012 @ 4:24 pm

  108. I solved it by filling title field in Yoast SEO, but this way I have only English title for all languages, what it not the best solution :(

    Comment by Ruslan — 2 June, 2012 @ 7:21 pm

  109. Only “For users of qTranslate META 0.9.1 and older, to make the plugin work on a “static” homepage you should change the title hook used from single_post_title to wp_title (in qtranslate-meta.php, line 29).” helped me on version 1.0.0!!!!!!!!

    Comment by Ruslan — 16 June, 2012 @ 5:11 pm

  110. hi there!
    great plugin! i have one small problem – maybe i oversee something, but i get the meta tags of the first post also in the category and tag pages which leads to double content. is there an easy way to avoid this (if … remove_action)?
    thanks for your work and help!

    Comment by patricio — 25 June, 2012 @ 5:25 pm

  111. Hi Patricio,
    Yes this is a very good point. I think I know the solution: place the following line in your qtranslate-meta.php file, in the beginning of the hook_head function (line 163):

    if (!(is_single() || is_page())) return;

    Let me know if this works correctly, and I will push it as an update to the plugin.

    Comment by John — 27 June, 2012 @ 9:20 am

  112. perfect! thanks a lot!!! that did the job with just one line of code :)

    Comment by patricio — 27 June, 2012 @ 10:44 am

  113. Google does not index the text in the Description and Keywords. Why?
    Text in Russian. But it is obvious that he is different.
    http://savepic.ru/3191415.jpg
    http://savepic.ru/3192439.jpg

    Comment by Eugen — 18 September, 2012 @ 1:54 am

  114. We can’t control what Google does Eugen! It is almost agreed that META tags are useless when it comes to SEO anyway; since they are so easily abused, many say that the major search engines to do not even pay attention to them.

    Comment by John — 18 September, 2012 @ 7:20 am

  115. I do not understand. Why do I need your plugin?
    Can I remove the plugin? It can not hurt to index blog?

    Comment by Eugen — 18 September, 2012 @ 3:40 pm

  116. It depends on why you want meta tags in the first place, and that’s not up to me to decide for you. If meta tags are not important to you, then yes you should remove this plugin.

    Comment by John — 18 September, 2012 @ 4:55 pm

  117. Hi, I am having two problesm here.
    1) Titles in different languages are not in the source code of no pages, but Descriptions are
    2) Descriptions are in the source code twice, both called meta name=”description” content=””: the fist occurrence of the meta description is that of the main language of the site, the second is that of the language of the page. I need to mainly solve the title issue, but even the second would be appreciated.
    Here is what I have on my WP site:
    Site based on twenty eleven child (the child is just changed in the CSS for background colours and fonts)
    Static Pages as main
    YOAST SEO, set to rewrite title, and title taxonomy is %%title%% (but this should not affect anything because it is rewritten)
    (I also tried to disable the rewrite, but a lot of duplications in one sinngle meta title occurrs so I have all the languages one after the other, + the title of the site. Also tried WITHOUT the rewrite and WITHOUT the %%title%% taxonomy, nothing changed, and also emptying all the SEO TITLES fields… in the latter case the result was all the page titles in all the languages one after the other)
    QTranslate Meta with settings to wp_title in the hook
    General settings title of the blog st up with [:en] xxxxxxx [:ru] yyyyyyy etc and that part works in the body but NOT IN THE META
    I tried all the solutions suggested in the thread but none worked.
    Please help me :)
    Thanks

    Comment by efffetti — 9 November, 2012 @ 3:23 pm

  118. It’s difficult for me to tell what’s going on without seeing your source code, but this sounds like to me like a conflict between your other SEO plugin and qTranslate META. As stated on the plugin homepage, I have not tested the plugin with any other SEO plugin and do not intend to.
    I can’t solve your problem directly, but perhaps trying the following may give you some clues:

    1. Look in your database to see if the META information is saved correctly. Look at the table wp_postmeta, where the meta_key column begins with qtrans_meta:. This is kindof low-level but will help establish if the meta information itself has become corrupted.
    2. Create a local duplicate of the site (and database), completely uninstall the other SEO plugin, use a default theme with no customisations, and see what happens then.

    The qtranslate META plugin itself is not that complicated, and you will probably be able to figure out what it’s doing by looking at the qtranslate-meta.php. Debugging WordPress loop stuff can be a hassle because you never know where hooks are being registered, and in which order they’re firing. There are WordPress plugins for helping with this, but in general it means getting very in depth and truly understanding what’s going on. It’s difficult to provide a quick solution in cases like these.

    Comment by John — 9 November, 2012 @ 8:00 pm

Leave a comment