Ok, here’s what I have so far, please share any changes you make:
WPSEO ver. 1.5.2.5
\wordpress-seo\js\wp-seo-metabox.js
line 279
-- var desc = jQuery.trim(yst_clean(descElm.val()));
++ var desc = jQuery.trim(descElm.val());
save wp-seo-metabox.js as wp-seo-metabox.min.js
in theme folder add to functions.php
// Enable qTranslate for WordPress SEO
if(defined("QT_SUPPORTED_WP_VERSION")) {
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);
}
function wpseo_qtranslate4($post_content) {
if(function_exists('qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage')) $post_content = qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage($post_content);
return $post_content;
}
add_filter('wpseo_heading_title4', 'wpseo_qtranslate4');
\wp-content\plugins\wordpress-seo\admin\class-metabox.php
line 1872
-- $post_content = apply_filters( 'wpseo_pre_analysis_post_content', $post->post_content, $post );
++ $post_content = apply_filters( 'wpseo_heading_title4', $post->post_content, $post );
This change is better to use original filter but when I was testing I used the changes listed and it seems to work.
another filter on line 1138 haven’t tested it yet.
with the changes above the Page analysis seems to work also I only see 1 lang in snippet preview, but focus keyword count is wrong.
I can see all langs in seo title and meta description.
If you or anyone else have further changes or improvements please add them.
Sitemaps for langs changes:
class-sitemaps.php (wordpress-seo/inc/) only add //Leslie ( some of the code around has been changed but you will see where to add it, thats why I left extra lines in place, also change yoursite.com, add/ remove langs as needed.)
if ( $n == 1 ) {
$front_id = get_option( 'page_on_front' );
if ( ! $front_id && ( $post_type == 'post' || $post_type == 'page' ) ) {
$output .= $this->sitemap_url( array(
'loc' => home_url( '/' ),
'pri' => 1,
'chf' => 'daily',
) );
// Leslie Start - Home Page Langs in Page
$output .= $this->sitemap_url( array(
'loc' => home_url( '/da/' ),
'pri' => 0.9,
'chf' => 'daily',
) );
$output .= $this->sitemap_url( array(
'loc' => home_url( '/de/' ),
'pri' => 0.9,
'chf' => 'daily',
) );
$output .= $this->sitemap_url( array(
'loc' => home_url( '/es/' ),
'pri' => 0.9,
'chf' => 'daily',
) );
$output .= $this->sitemap_url( array(
'loc' => home_url( '/no/' ),
'pri' => 0.9,
'chf' => 'daily',
) );
$output .= $this->sitemap_url( array(
'loc' => home_url( '/pt/' ),
'pri' => 0.9,
'chf' => 'daily',
) );
$output .= $this->sitemap_url( array(
'loc' => home_url( '/sv/' ),
'pri' => 0.9,
'chf' => 'daily',
) );
$output .= $this->sitemap_url( array(
'loc' => home_url( '/fr/' ),
'pri' => 0.9,
'chf' => 'daily',
) );
$output .= $this->sitemap_url( array(
'loc' => home_url( '/nl/' ),
'pri' => 0.9,
'chf' => 'daily',
) );
$output .= $this->sitemap_url( array(
'loc' => home_url( '/it/' ),
'pri' => 0.9,
'chf' => 'daily',
) );
// Leslie End
}
else if ( $front_id && $post_type == 'post' ) {
$url['images'] = apply_filters( 'wpseo_sitemap_urlimages', $url['images'], $p->ID );
if ( ! in_array( $url['loc'], $stackedurls ) ) {
// Use this filter to adjust the entry before it gets added to the sitemap
$url = apply_filters( 'wpseo_sitemap_entry', $url, 'post', $p );
if ( ! empty( $url ) ) {
$output .= $this->sitemap_url( $url );
// Leslie Start - Posts & Pages
// $output = str_replace(">0.6<", ">0.5<", $output);
$url = str_replace("yoursite.com/", "yoursite.com/da/", $url);
$output .= $this->sitemap_url( $url );
$url = str_replace("/da/", "/de/", $url);
$output .= $this->sitemap_url( $url );
$url = str_replace("/de/", "/es/", $url);
$output .= $this->sitemap_url( $url );
$url = str_replace("/es/", "/no/", $url);
$output .= $this->sitemap_url( $url );
$url = str_replace("/no/", "/pt/", $url);
$output .= $this->sitemap_url( $url );
$url = str_replace("/pt/", "/sv/", $url);
$output .= $this->sitemap_url( $url );
$url = str_replace("/sv/", "/fr/", $url);
$output .= $this->sitemap_url( $url );
$url = str_replace("/fr/", "/nl/", $url);
$output .= $this->sitemap_url( $url );
$url = str_replace("/nl/", "/it/", $url);
$output .= $this->sitemap_url( $url );
// Leslie End
$stackedurls[] = $url['loc'];
}
}
// Clear the post_meta and the term cache for the post, as we no longer need it now.
// wp_cache_delete( $p->ID, 'post_meta' );
// clean_object_term_cache( $p->ID, $post_type );
$url['mod'] = $wpdb->get_var( $sql );
$url['chf'] = 'weekly';
// Use this filter to adjust the entry before it gets added to the sitemap
$url = apply_filters( 'wpseo_sitemap_entry', $url, 'term', $c );
if ( ! empty( $url ) )
$output .= $this->sitemap_url( $url );
// Leslie Start -Category
// $output = str_replace(">0.6<", ">0.5<", $output);
$url = str_replace("yoursite.com/", "yoursite.com/da/", $url);
$output .= $this->sitemap_url( $url );
$url = str_replace("/da/", "/de/", $url);
$output .= $this->sitemap_url( $url );
$url = str_replace("/de/", "/es/", $url);
$output .= $this->sitemap_url( $url );
$url = str_replace("/es/", "/no/", $url);
$output .= $this->sitemap_url( $url );
$url = str_replace("/no/", "/pt/", $url);
$output .= $this->sitemap_url( $url );
$url = str_replace("/pt/", "/sv/", $url);
$output .= $this->sitemap_url( $url );
$url = str_replace("/sv/", "/fr/", $url);
$output .= $this->sitemap_url( $url );
$url = str_replace("/fr/", "/nl/", $url);
$output .= $this->sitemap_url( $url );
$url = str_replace("/nl/", "/it/", $url);
$output .= $this->sitemap_url( $url );
// Leslie End
}
if ( empty( $output ) ) {
$this->bad_sitemap = true;
return;
}
$this->sitemap = '<urlset xmlns:xsi="https://www.w3.org/2001/XMLSchema-instance" ';
$this->sitemap .= 'xsi:schemaLocation="https://www.sitemaps.org/schemas/sitemap/0.9 https://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd" ';
$this->sitemap .= 'xmlns="https://www.sitemaps.org/schemas/sitemap/0.9">' . "\n";
$this->sitemap .= $output . '</urlset>';
}
/**
* Build the sub-sitemap for authors
$this->sitemap = '<urlset xmlns:xsi="https://www.w3.org/2001/XMLSchema-instance" xmlns:image="https://www.google.com/schemas/sitemap-image/1.1" ';
$this->sitemap .= 'xsi:schemaLocation="https://www.sitemaps.org/schemas/sitemap/0.9 https://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd" ';
$this->sitemap .= 'xmlns="https://www.sitemaps.org/schemas/sitemap/0.9">' . "\n";
$this->sitemap .= $output;
// Leslie Start -Authors
$output = str_replace("ty>0.8</pr", "ty>0.5</pr", $output);
$output = str_replace("yoursite.com/", "yoursite.com/da/", $output);
$this->sitemap .= $output;
$output = str_replace("/da/", "/de/", $output);
$this->sitemap .= $output;
$output = str_replace("/de/", "/es/", $output);
$this->sitemap .= $output;
$output = str_replace("/es/", "/no/", $output);
$this->sitemap .= $output;
$output = str_replace("/no/", "/pt/", $output);
$this->sitemap .= $output;
$output = str_replace("/pt/", "/sv/", $output);
$this->sitemap .= $output;
$output = str_replace("/sv/", "/fr/", $output);
$this->sitemap .= $output;
$output = str_replace("/fr/", "/nl/", $output);
$this->sitemap .= $output;
$output = str_replace("/nl/", "/it/", $output);
$this->sitemap .= $output;
// Leslie End
// Filter to allow adding extra URLs, only do this on the first XML sitemap, not on all.
if ( $n == 0 )
$this->sitemap .= apply_filters( 'wpseo_sitemap_author_content', '' );
$this->sitemap .= '</urlset>';
}
/**
* Spits out the XSL for the XML sitemap.
Comment out images
//if ( isset( $url['images'] ) && count( $url['images'] ) > 0 ) {
// foreach ( $url['images'] as $img ) {
// if ( ! isset( $img['src'] ) || empty( $img['src'] ) )
// continue;
// $output .= "\t\t<image:image>\n";
// $output .= "\t\t\t<image:loc>" . esc_html( $img['src'] ) . "</image:loc>\n";
// if ( isset( $img['title'] ) && ! empty( $img['title'] ) )
// $output .= "\t\t\t<image:title>" . _wp_specialchars( html_entity_decode( $img['title'], ENT_QUOTES, get_bloginfo( 'charset' ) ) ) . "</image:title>\n";
// if ( isset( $img['alt'] ) && ! empty( $img['alt'] ) )
// $output .= "\t\t\t<image:caption>" . _wp_specialchars( html_entity_decode( $img['alt'], ENT_QUOTES, get_bloginfo( 'charset' ) ) ) . "</image:caption>\n";
// $output .= "\t\t</image:image>\n";
// }
//}