Multilingual META tags

Having Problems? Need Help? Post here!

Multilingual META tags

Postby jstar198 » Mon Jan 11, 2010 6:27 am

I needed to have multilingual keywords & descriptions on my site, so I created a plugins which uses qTranslate to do exactly this.
Check it out here, and let me know what you think.
http://wordpress.org/extend/plugins/qtranslate-meta/

John
jstar198
 
Posts: 15
Joined: Sun Jul 12, 2009 9:07 pm

Re: Multilingual META tags

Postby jacksmith » Mon Jan 11, 2010 10:12 am

I do not think it's tough work for you to do multilingual META tags.
jacksmith
 
Posts: 3
Joined: Wed Jan 06, 2010 6:47 am

Re: Multilingual META tags

Postby duniaaqar » Sat Feb 06, 2010 2:29 pm

i'm using version 2.8.6 with qtranslate to have the site in arabic as well as english. Do i need the qtranslate meta to have the actual arabic content referenced on arabic searches? I have been informed that my arabic pages are being seen an english by crawlers???!!!
duniaaqar
 
Posts: 1
Joined: Sat Feb 06, 2010 1:56 pm

Re: Multilingual META tags

Postby magicsun » Thu Mar 31, 2011 11:22 am

What about the homepage?

I don't have a static homepage, so there's no "home" page created ... Where do I fill in that information for the english homepage?
magicsun
 
Posts: 5
Joined: Mon Mar 28, 2011 2:56 pm

Re: Multilingual META tags

Postby idesignstudio » Tue Apr 05, 2011 10:14 pm

Did anyone tried to use qTranslate with WPMU DEV SEO plugin or Yoast and the top of the WP/WPMU SEO plugins?
They have some similarities as well as differences and are powerful for WP/WPMU SEO.

If there are others interested implementing qTranslate with them, let me know and we can work together on it.

Cheers,
Milena
idesignstudio
 
Posts: 4
Joined: Tue Apr 05, 2011 6:05 pm

Re: Multilingual META tags

Postby zenger » Fri Apr 15, 2011 11:47 am

I registered only to help you. :) I know this is not the best option but it is the least I've managed to do. So to use multilingual Yoast Seo meta tags you should do the following steps.
edit the following file.
Code: Select all
your-web-site\wp-content\plugins\wordpress-seo\frontend\class-frontend.php

ad the top of the file in the class after the row
Code: Select all
class WPSEO_Frontend { ~ line 3
and add the following line
Code: Select all
function tt($var) {
   return __($var);
}

this will bring the __("") function inside the Wordpress Seo class.
Next at line ~ 210 where is
Code: Select all
return esc_html( strip_tags( stripslashes($title  ) ) );
change to this
Code: Select all
return esc_html( strip_tags( stripslashes( $this->tt( $title ) ) ) );

now you can make multilingual titles.
for keywords at line ~427 where is
Code: Select all
   echo "\t<meta name='keywords' content='".esc_attr( strip_tags( stripslashes( $metakey ) ) )."'/>\n";
change to this
Code: Select all
   echo "\t<meta name='keywords' content='".esc_attr( strip_tags( stripslashes( $this->tt($metakey) ) ) )."'/>\n";

for description at line ~474 wher is
Code: Select all
return $metadesc;
change to
Code: Select all
return $this->tt($metadesc);


now inside the Yoast Seo plugin where is title you can use [:en]Hello World[:ru]Привет Мир! ..
I think that the Yoast Seo is pretty cool :) I hope this will get to google and will help people :)
zenger
 
Posts: 1
Joined: Fri Apr 15, 2011 11:39 am

Re: Multilingual META tags

Postby Bryn » Tue Oct 18, 2011 11:30 am

Hi Zenger,
Thanks for your suggestion! Unfortunately, the Yoast code changed, and now at line 212 you can find this:
Code: Select all
return esc_html( strip_tags( stripslashes( apply_filters( 'wpseo_title', $title ) ) ) );

The other bits of code are unchanged. Can you please let us know how can we update the mod you suggested, so to allow us to use Yoast's latest version?

Thanks!
Bryn
 
Posts: 7
Joined: Mon Feb 07, 2011 6:36 pm

Re: Multilingual META tags

Postby solala » Sat Nov 05, 2011 7:06 pm

Just to answer your question, it would look like this:

original:
Code: Select all
return esc_html( strip_tags( stripslashes( apply_filters( 'wpseo_title', $title ) ) ) );

edited:
Code: Select all
return esc_html( strip_tags( stripslashes( $this->tt( apply_filters( 'wpseo_title', $title ) ) ) ) );


However, it doesn't really work with the latest version of WordPress SEO by Yoast (1.0.3).

The solution which works with WordPress SEO by Yoast and WP 3.2.1 is to make a little hack (Yoast) and use the qTranslate META plugin.

What worked for me: Take the original <...>/wp-content/plugins/wordpress-seo/frontend/class-frontend.php and
search for:
Code: Select all
echo "<meta name='keywords' content='".esc_attr( strip_tags( stripslashes( $this->tt($metakey) ) ) )."'/>\n";
and replace by
Code: Select all
/*echo "<meta name='keywords' content='".esc_attr( strip_tags( stripslashes( $this->tt($metakey) ) ) )."'/>\n"*/;


search for:
Code: Select all
echo "<meta name='description' content='".esc_attr( strip_tags( stripslashes( $metadesc ) ) )."'/>\n";
and replace by
Code: Select all
/*echo "<meta name='description' content='".esc_attr( strip_tags( stripslashes( $metadesc ) ) )."'/>\n"*/;

IMPORTANT: in both cases, leave the line end with ";" not commented out!!!

Finally, when you edit your article/page and you use the WordPress SEO by Yoast Plugin, do not type anything in the field "SEO Title:"
(You may only use this field "SEO Title" temporarely in order to see the "Snipplet Preview". Once it fits your requirement, cut the text and paste it in the field "Browser title" of qTranslate META.)
For your multilingual META (title, keywords, description), use qTranslate META instead.

Since it took me a lot of time to figure out how it works, you may consider to
Image me a beer ;)
solala
 
Posts: 2
Joined: Sat Nov 05, 2011 6:59 pm

Re: Multilingual META tags

Postby GhostMaster » Tue Nov 22, 2011 2:13 am

2 SEO plugins at the same time? Are you sure?
GhostMaster
 
Posts: 29
Joined: Thu Jun 23, 2011 8:07 pm

Re: Multilingual META tags

Postby BusinessStream » Tue Mar 06, 2012 4:34 pm

GhostMaster wrote:2 SEO plugins at the same time? Are you sure?


I am quite hesitant.
BusinessStream
 
Posts: 1
Joined: Tue Mar 06, 2012 4:31 pm

Next

Return to qTranslate Support Forum

Who is online

Users browsing this forum: Google [Bot], Google Adsense [Bot], jakobolsen and 11 guests