Qtranslate and meta-tags…solved again

multilingualHandling multilanguage content is one of the most challenging tasks for a WordPress plugin – I will share my advice on how to turn WordPress into a simple multilanguage CMS, with decent SEO, in minutes. I’ve been experimenting with different plugins and my own SEO add-on, and found a viable solution for most tasks.

qTranslate is a great solution for creating a multilanguage blog/website. I’ve experimented with it quite a bit, and absolutely love it.

It works right out of the box and allows you to easily manage your content and add languages when you want – it is a “plug and play” solution, making WordPress a multilingual CMS in minutes! There is a big flaw unfortunately, especially if you care to optimize your pages and posts for the search engines: no support for meta-tags. Too bad!  This made qTranslate useless to me, and to many people too. We try to solve this flaw with a simple plugin.

BTW…I really hope  Matt Mullenweg will eventually decide to make WordPress natively multilingual!

Let’s go back on topic.

TITLE and DESCRIPTION – All SEO-savvy webmasters know the importance of hand-tailoring these important bits of information.

[If you're asking why no KEYWORDS...you might find out why asking a good SEO - it's completely useless nowadays.]

The problem I found with the qTranslate multilanguage plugin is the   lack of meta tag support; no way to customize the post/page TITLE and DESCRIPTION meta tags: the usual beloved HeadSpace is not (yet, we all hope) compatible with qTranslate, nor it’s alternative All in One SEO pack – well, some folks have been able to make it work but I don’t like the solution, looks rather fussy to me, and error-prone.

This is why I wrote some years ago a  plugin called   qTranslateMeta. It lets you enter custom page TITLE and meta DESCRIPTION tags for each post/page, and it works with qTranslate. It is very rough but very lightweight – only one file, very few lines of code which will help you make qTranslate a workable solution even  if you care about SEO!

Then, in 2012  I found out another guy developed a more powerful version available here.


A new solution, but another problem: home page title is wrong, WTF! My fix:

The only problem with qTranslateMeta: in my installs the site’s homepage was outputting a wrong page title.

If you have the same problem try hacking your theme’s header.php file this way :

 

<title><?php

function CustomQtPage_title()
{ return __(get_post_meta((get_the_ID()), “qtrans_meta:title”, TRUE));
}

if (is_front_page()) add_filter(“wp_title”, CustomQtPage_title, 100);

wp_title(“”);

?></title>

PS: remember to convert the “s :-)

Add to your list
Be Sociable, Share!

31 thoughts on “Qtranslate and meta-tags…solved again

  1. Dany Gamarra

    Hello, I’m using qtranslate for my blog and I decided to try your plugin, so I downloaded it and tried to install it, but I get an error. I used the installation utility from wordpress, so I selected the zip file of the plugin, and it unzips the php file, but then I get the error:

    Plugin file does not exist.

    Could you tell me how to fix this, thank you.

  2. Dany Gamarra

    Sorry. Found out how to fix it, it has to be uploaded in a directory with the same name, so just as a suggestion, the files in the zip file could already be inside a directory, so the wordpress installation utility would work just fine.

  3. Wolfgang Marx

    I’m new to wordpress and still getting to know the system but Im starting to get inquiries for multi language cms sites based on wordpress… so this is more than handy.

    many thanks on my behalf.

  4. kris

    Hi,
    What about for using more than 2 languages.
    I’m building website with 4 languages … It seems I need of 12 custom fields for all meta tags and titles. It’s hard for maintenance.
    That’s what I’ve done:
    Forget about any SEO plugin. Just use the custom fields: one for “description” and one more for “keywords”. The “title” comes with the page. I have used qtranslate function for multilingual output:

    qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage(get_post_meta($post->ID,’description’,true));

    The entry at the custom field “description” looks like this:

    English descriptionFrench description.

    It isn’t more time consuming, is it?

    Chears
    Kris

  5. kris

    Sorry, it was not my fault:

    The entry at the custom field “description” looks like this:

    English descriptionFrench description

  6. kris

    Sorry, it was not my fault:

    The entry at the custom field “description” looks like this:

    < ! – - : en – - >English description< ! – - : – - >< ! – - : fr – - >French description< ! – - : – - >

  7. Mireia

    Hello.
    I’m using qtranslate and i’ve just tried to intall your plugin. I can’t make it work. When i try to create the custom fields for each languaje it sais there is an unknown error. I’ve tried to upload the plugin in a directory with the same name (i tried “qTranslateMeta” and “qtrans-metatags”) but it still doesn’t work.
    Could anyone help me? Thanx.

  8. John conrad

    I found your blog by chance . but i have to say that it’s great blog very useful information and very interesting subjects just greetings and good luck
    i’m not going i will be always checking for updates.I’m very interested in CMS and all its related subjects.

  9. Peter

    Hey, sounds like a good solution to a really major issue. Any one tried this with the latest version of WordPress 2.8? I’ll give it a go within the next few days and post back with what happens.

  10. Ana

    THANKS

    really thanks!

    FRom seo point of view you really made my life easier !

    is there a way to create also keywords tag for each language?

  11. Orhan

    It is nice that somebody has given to itself the trouble. WordPress in several languages and with Metatags Able of SEO has made.

  12. Aldo

    It looks good, but when you create a website/blog for a client you cannot ask them to use the “custom fields”.

    I’d rather prefer a plugin that makes “All in one SEO plugin” (or other) multilungual, so the user authors will see the SEO fields separated in tabs for every language.

  13. johnny

    thanks for your efforts.
    although it seems that the latest version of qtranslate fixed the issue I am about to test everything on my mom’s B&B website.
    Until now I was just doing a home style double language site with links to the italian page from the english one but its a bit messy.
    Will see how things go in the next days.
    Grazie!

  14. enricostn

    Hi,

    just one question, do qtranslate 2.5.28 works for you on WP 3.3.1? I mean without all those PHP warnings about qtranslate_hooks.php…

    thank you for sharing and great post!

    enrico

  15. Starh

    Hi and thank you for creating this plugin. It works great for pages/posts but my problem is implementing it in projects and skills pages. Do you have a solution for this?

  16. Создание сайтов

    Hello! I’m create a plugin for optimize description meta tag in wordpress site.
    You can download it here. How it works You can read in admin panel, on plugin page.

    Also, I has a problem with tag\category description. I had to use html markup (for images, videos and other) and qtranslate together.

    So, for insert html in tag/category description I added in fucntion.php of my current theme:

    foreach ( array( 'pre_term_description' ) as $filter ) {
    remove_filter( $filter, 'wp_filter_kses' );
    }
    foreach ( array( 'term_description' ) as $filter ) {
    remove_filter( $filter, 'wp_kses_data' );
    }

    But English descriptionFrench description not works and all translations were shown on the tag pages.
    Then I replaced

    to

    in tag.php of my theme.

    Result You can see on my site html5 tag
    Enjoy!

Comments are closed.