Skip Navigation

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 16 replies, has 3 voices.

Last updated by Andreas Neuber 7 years, 8 months ago.

Assigned support staff: Andreas Neuber.

Author Posts
April 5, 2013 at 1:19 am #117150

Zelimir

Hi, I have a website that has one language per directory (website.com/hr/, website.com/de/, etc). I need to make a sitemap per language, and as I just found out, this seems to be impossible, right? I tried with Yoast, and please don`t tell me that I need to have per-subdomain language structure, because I am going to freak out. The Yoast SEO plugin is placing all language versions in one sitemap, and this will get banned from Webmaster in a second.

So, is there not a way to create a normal sitemap with properly divided language structure? C`mon, it can`t be just for subdomains, what`s the point of even creating language versions per directory if you cannot properly index it?

Thanks
Zelimir

April 5, 2013 at 8:08 am #117182

Andreas Neuber
Supporter

Languages: English (English ) German (Deutsch )

Hello Zelimir,

I see the problem there - let me consult with me colleagues about the solution for sitemap per language and I will come back to you soon.

April 5, 2013 at 12:32 pm #117275

Zelimir

Hi, ok, thank you very much.

Cheers
Zelimir

April 8, 2013 at 12:58 am #117607

Zelimir

Hi, any updates on this? I need to push the site live for a client, which means applying the sitemap to Webmaster, and I`m afraid that the languages will get mixed up during indexing, which might result in a poor search engine ranking for my client.

Thanks
Zelimir

April 9, 2013 at 7:32 am #117885

Andreas Neuber
Supporter

Languages: English (English ) German (Deutsch )

Hello Zelimir,

Sorry for the delay!
According to our developers I've talked to, WP SEO by Yoast does definitely support what you need.

However, since this is exactly the plugin you are using and configuration seems not so easy it makes sense that our developers have also a look then at your settings.

Would you mind providing me with credentials for your website and I have a quick closer look at the settings? I will sent you an email with more details in a minute.

April 10, 2013 at 9:22 am #118194

Ralf

Same "problem" here although I think yoast SEO plugin just works with different TLDs and not with the folder based structure. A solution would be appreciated a lot!

As it works with TLDs it shouldn't be so much work to make it work the same way with folder based languages?!

April 11, 2013 at 9:58 am #118508

Ralf

Any news?

April 15, 2013 at 3:34 pm #119434

Ralf

Are there any news on this topic? I just want to know if it's going to be fixed or if I have to look for another solution. Some kind of status update would be nice...

April 16, 2013 at 9:39 am #119655

Ralf

No response at all after one week isn't so nice 🙁

April 18, 2013 at 10:51 pm #120873

Zelimir

Hi, just checking - have you examined my test site, and are there any news on the issue?

Thanks
Zelimir

April 19, 2013 at 12:53 pm #121023

Andreas Neuber
Supporter

Languages: English (English ) German (Deutsch )

Hello Zelimir and Ralf,

Sorry for the delay!
Ok, normally its only possible for the "domain per language" setting.
But there is a workaround.

Could you add this to the 'functions.php' of your theme and let me know if it solves the problem?

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'";
}
April 26, 2013 at 12:16 am #122750

Zelimir

Hi Andreas, I put the code in the functions.php, and it did nothing. Please take a look for yourself on the test version for which I had sent you the information.

Thanks
Zelimir

April 26, 2013 at 9:00 am #122834

Andreas Neuber
Supporter

Languages: English (English ) German (Deutsch )

Hello Zelimir,

We had a quick look into your "functions.php". The provided code was inside a if/else - lines 148-2170.
I moved it outside and now things look more correct.

hidden link
--> German posts: hidden link
--> Croation hidden link

--
http://wpml.org/2011/12/wpml-2-4-2-content-duplication-and-wysiwyg-custom-fields/

May 11, 2013 at 11:05 am #126501

Zelimir

Hi Andreas, sorry that it took me so long to answer, I seem to be losing e-mails from WPML in my GMAIL account, they seem to be falling below the important mails, I need to take care of this ASAP.

Anyway, thank you very much for your help, it is so appreciated! I can confirm that it is working. I just have one more question - is this a solution that will work if I add more languages, and can I take this out of functions.php and make a plugin out of it, so that I don`t have to mix it with any of the client themes?

Thank you once again
Zelimir

May 11, 2013 at 11:27 am #126503

Zelimir

Hi Andreas, well, my cheerful mood was short lived - I have a little pesky issue with the sitemap now - on the original site (the live site) when turned on the plugin (yeah I made it into a plugin and it works great) I lost the most important sitemap - the one with all the real estate listings, the /~clubplus/listing/. Do you have any idea how this might have happened, and what should I do?

Thanks
Zelimir

The topic ‘[Closed] Sitemap per language (subdirectory structure)’ is closed to new replies.