Please make sure to update to WPML 4.3.4 before reporting any issue

Hi, Amit here, I am the WPML Support Manager, our current ticket queue is high, update your WPML plugins and make sure you meet the minimal requirements for running WPML before reporting an issue please - many tickets are resolved doing that

Please look at our updated list of Known Issues and you can also use our support search to find helpful information and of course review our documentation before opening a ticket.

If you do need to open a ticket please make sure to provide us with all the needed information as described in this page

This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

This topic contains 7 replies, has 2 voices.

Last updated by sarah.n 6 years, 8 months ago.

Assigned support staff: sarah.n.

Author Posts
March 19, 2013 at 8:43 pm #113266

Guillaume

Hi everybody,

I encounter the same problems as other users with a website using Yoast sitemap, available for years in French, and in English thanks to WPML since a few weeks, using a /en/ directory. My website appears in Google EN results far, far away, and it's the French homepage which is shown!

I do have the .com and the .fr but my problem is that the French version of the website has been available on the .com for years ; I don't want to lose all my SEO efforts, and I fear entering in a huge redirection process 🙂

Looking at the details of my sitemap.xml, it appears that the English homepage with the URL ending with /en/ is not even mentioned!

I think I will have to test the solution "1 domain per language". My question is simple: Do you think I can activate this option and possibly go backward to the /en/ directory solution if any problem occurs, without having my website all messed up?

Thank you for your help.

Guillaume

March 20, 2013 at 7:17 am #113298

sarah.n
Supporter

Languages: English (English ) German (Deutsch )

Guillaume,

Is your intention to display sitemaps per language?

March 20, 2013 at 7:32 am #113303

Guillaume

Hi Sarah,
Thank you for your message.
I would say that my intention is to have my English pages, specially my homepage, pulled up in search results.
If the only way is to display a sitemap per language, i.e. per domain, I'll have to test your "1 domain per language" option.
But if I could stay with my current settings I would also appreciate. I even imagined to deactivate Yoast sitemaps and deal with them by hand, but this can't be a solution...
Is there technically a risk in WPML activating / deactivating the WPML 1 domain per language as I'm not sure it will work?
Thank you for your help,
Guillaume

March 20, 2013 at 7:49 am #113309

sarah.n
Supporter

Languages: English (English ) German (Deutsch )

Guillaume,

You wrote:

If the only way is to display a sitemap per language, i.e. per domain, I'll have to test your "1 domain per language" option.

If you add the following function in your theme's functions.php file you do not need to change your language negotiation setting to domain per language:

if (isset($sitepress)) add_filter('wpseo_posts_join', 'sitemap_per_language', 10, 2);
function sitemap_per_language($join, $type) {
global $wpdb, $sitepress;
$lang = $sitepress->get_current_language();
return " JOIN " . $wpdb->prefix . "icl_translations ON element_id = ID AND element_type = 'post_$type' AND language_code = '$lang'";
}

What the above does is, it filters urls in the sitemap according to the language in the url (current language).

I am not sure about the sitemap index, however that can be built manually or sitemaps submitted individually as explained here: http://wpml.org/2011/12/wpml-2-4-2-content-duplication-and-wysiwyg-custom-fields/ but the actual sitemap works with the function above.

Finally in reply to

Is there technically a risk in WPML activating / deactivating the WPML 1 domain per language as I'm not sure it will work?

No, there is not however I would always recommend to backup your database first before you proceed! Better be safe than sorry don't you think?

You can use a plugin for this if you like such as: http://wordpress.org/extend/plugins/wp-db-backup/

March 20, 2013 at 8:20 am #113323

Guillaume

Thank you Sarah for your great help, as usual.
I've pasted the function in my functions.php file and I'm checking the results.
Guillaume

March 20, 2013 at 8:50 am #113332

sarah.n
Supporter

Languages: English (English ) German (Deutsch )

Good. Let me know how you get on with it.

March 20, 2013 at 9:17 am #113341

Guillaume

It worked for the different sitemaps except for the index, as you supposed, neither for the attachments. I've added the English page, post, tag and category sitemaps to GG Webmaster Tools and will let you know in a few days if I find any improvement on my Google results. Thank you again.

March 20, 2013 at 9:37 am #113347

sarah.n
Supporter

Languages: English (English ) German (Deutsch )

OK thank you for the update. I'll be here if and when you need me.

The topic ‘[Closed] Activating / deactivating 1 domain per language?’ is closed to new replies.