Support » Plugin: Yoast SEO » [Plugin: WordPress SEO by Yoast] Please put the 'load_plugin_textdomain' on 'init&amp

Viewing 3 replies - 1 through 3 (of 3 total)
  • I already made the same request some months ago

    As far as I know, the way WordPress SEO is written should break *all* multilingual plugins, not only Polylang. I tested with WP Native Dashboard and qtranslate too. And although WPML and WordPress SEO claim to be 100% compatible, I am quite sure that WPML does not load the right text domain, except of course if it reloads it as proposed below.

    So currently, the only solution I can propose waiting for @joostdevalk to modify his plugin is to reload the wordpress-seo texdomain in a function hooked (for example) to ‘init’:

    add_action ('init', 'reload_wp_seo_text_domain');
    function reload_wp_seo_text_domain {
      unload_textdomain('wordpress-seo'); // mandatory !
      load_plugin_textdomain( 'wordpress-seo', false, '/wordpress-seo/languages' );

    Not very good for performance as it is loaded two times, but this seems to work with Polylang. I did not check with other multilingual plugins.

    Same problem here. Thanks Chouby for pointing me into that direction. Here is a fix that doesn’t load locale file twice. We override the Wp-Seo’s call when it’s called before ‘plugins_loaded’ action.

    function reload_wp_seo_text_domain() {
      load_plugin_textdomain( 'wordpress-seo', false, '/wordpress-seo/languages' );
    add_action ('plugins_loaded', 'reload_wp_seo_text_domain');
    function override_wp_seo_load_textdomain( $return, $domain ) {
    	if ( $domain == 'wordpress-seo' && ! did_action( 'plugins_loaded' ) ) {
    		return true;
    	return $return;
    add_filter( 'override_load_textdomain', 'override_wp_seo_load_textdomain', 10, 2 );

    For that to work with theme’s function.php you should probably use the ‘init’ action but for mu-plugins this works best.

    Is it possible that get put to the good standard and loaded at ‘init’ or ‘plugins_loaded’ at least. Thanks.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Plugin: WordPress SEO by Yoast] Please put the 'load_plugin_textdomain' on 'init&amp’ is closed to new replies.