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 13 replies, has 2 voices.

Last updated by Robert 5 years, 5 months ago.

Assigned support staff: Maciej.

Author Posts
January 22, 2015 at 5:10 am #546934



It's about hidden link
In the language switcher flag on the top the English flag wants to link to the hub-surf/"slug" instead of just the homepage. When I try to empty the slug it gives a default slug called 5-2.

I had this issue before on a different website and solved it by selecting the default post page in wp settings>reading settings. But now in both languages both the homepage and post page have a default page set.

My language selector code in header.php:

<div class="langselect">
<?php language_selector_flags(); ?>

I would like to solve this for SEO reasons.


January 22, 2015 at 12:06 pm #547175


Hello Robert,

I am sorry you are experiencing this issue with WPML.

Your code seems to be correct. Did you edit the sample function code for “Language selector with flags only” given on our Documentation page?

I would also ask you to add a language switcher to the footer for test purpose and see at the results.
You can enable the switcher by going to “WPML -> Languages -> Language switcher options
-> Footer language switcher style”

Can you please also tell what page is set to display as the Front page in “Settings -> Reading” section of your WordPress?

I also would like to ask you to provide information about your environment by following these steps:
Thank you.

January 22, 2015 at 12:23 pm #547187


I have this in my function.php. I forgot to mention. It's from your documentation.

function language_selector_flags(){
    $languages = icl_get_languages('skip_missing=0&orderby=code&order=desc');
        foreach($languages as $l){
            if(!$l['active']) echo '<a href="'.$l['url'].'">';
            echo '<img src="'.$l['country_flag_url'].'" height="12" alt="'.$l['language_code'].'" width="18" />';
            if(!$l['active']) echo '</a>';

The footer language switcher shows the same "slug"


January 22, 2015 at 1:07 pm #547226


Hello Robert,

Can you please tell me what page is set to display as the Front page in “Settings -> Reading” section of your WordPress?

Thank you.

January 22, 2015 at 2:57 pm #547318


Front page:Home, Post page: News
If I change the "slug" of home it changes the language selector link with it and includes that "slug"

January 22, 2015 at 3:44 pm #547343


Thank you for your replay.

Can you please tell me did you modify your .htaccess file?

Thank you.

January 22, 2015 at 3:54 pm #547352


No I didn't. Standard as far as I know.

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

# END WordPress
January 23, 2015 at 9:38 am #547712



I need to request temporary access (wp-admin and FTP) to your site in order to be of better help. You will find the needed fields for this below the comment area when you log in to leave your next reply.
The information you will enter is private which means only you and I can see and have access to it.

I would also recommend to backup your database and website first before we proceed. You can use a plugin for this if you like. I often use the Duplicator plugin for this purpose. See:

Thank you.

January 23, 2015 at 2:32 pm #547967


Hello Robert,

I found what is causing your problem.
Your theme is using the field post-name instead of post-title to create the url, WPML uses the post-title as this reflects the page/post hierarchy. This field should not be read to create URLs. The theme author should change his code to read the correct field for creating the URL. (screenshot)

To ensure that this theme is made compatible with WPML we need to contact the theme author and work with him on resolving the issue.

Could you please provide a link to your theme's download ( or purchase) page as well as contact information (email?) to the theme's/plugin’s author so we can contact him?

You do not need to do anything other than providing the theme's author name and email. We will contact the author.

Thank you.

January 25, 2015 at 2:33 am #548421


hidden link

They are have quite some sales, so hopefully they can resolve the issue 🙂
I've noticed with another website the slug on the flag can impact the results in Google.


January 26, 2015 at 7:31 am #548635


Hello Robert,

Thank you for the contact details you provided.
I will forward the details to our Themes & Plugins Compatibility Team and they will contact the author.
Please note that this process may take a while as it depends on how soon the author will reply to our efforts to contact him.
It would be great if you can also contact the author asking him to reply us. This may help expedite the process.
We are closing the ticket but we will keep it in our records. You will be notified the moment we have the author’s cooperation in this process.
Thank you.

January 26, 2015 at 8:09 am #548657


Ok great, thanks for the help! The theme only has a "comment" section for support questions so I send them this:


I’d like to refer to a ticket I’ve created at the WPML support. WPML will contact you regarding this in order to resolve the issue.

Thanks Rob

January 26, 2015 at 8:52 am #548679


They replied:
Hi there, I have actually no idea what he talks about. The theme does not choose the URL, it’s the permalinks settings that controls that. If not, could they post a detailed instruction at that form thread?

March 31, 2015 at 3:32 pm #591537