0

Find no solution for that problem!

[:de]German[:en]English

After saving the site its just like this: GermanEnglish

Title and keywords are working but the different description with two languages won´t work.

Thanks for your help!

2 Answers2

1

The problem is the javascript in Wordpress Seo PlugIn named: wp-seo-metabox.js

There is a javascript that "clean" the textarea value with a regex: function yst_clean(str) { if (str == '' || str == undefined) return '';

try {
    str = str.replace(/<\/?[^>]+>/gi, '');
    str = str.replace(/\[(.+?)\](.+?\[\/\\1\])?/g, '');
} catch (e) {
}

return str;

}

I have removed the try-catch block. I didn't know the reason why there is this regex, but in my case the plugins works fine without it.

erlangb
  • 521
  • 6
  • 13
0

My solution:

in functions.php

/**
* Enable qTranslate for WordPress SEO
*
* @param string $text The string to translate
*
* @return string
*/
function qtranslate_filter( $text ) {
return __( $text );
}

add_filter( 'wpseo_title', 'qtranslate_filter', 10, 1 );
add_filter( 'wpseo_metadesc', 'qtranslate_filter', 10, 1 );
add_filter( 'wpseo_metakey', 'qtranslate_filter', 10, 1 );
add_filter( 'wpseo_opengraph_title', 'qtranslate_filter', 10, 1 );

in wp-seo-metabox.js (/wp-content/plugins/wordpress-seo/js)

    function yst_clean(str) {
        if (str == '' || str == undefined)
            return '';

        try {
            str = str.replace(/<\/?[^>]+>/gi, '');
    //      str = str.replace(/\[(.+?)\](.+?\[\/\\1\])?/g, '');
        } catch (e) {
        }

    return str;
}