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

Last updated by lucM-5 2 years, 10 months ago.

Assigned support staff: Sumit.

Author Posts
January 15, 2017 at 2:54 pm #1182413

lucM-5

I have WPML configured with different directory per language. See attached screenshot.

URL of (my) website where problem appears: hidden link

With thins configuration, I'm amazed to see that

hidden link
hidden link

are accessible URL's. What's even worse is hidden link even appears at the top of Google Search results in Dutch language region - instead of the regular home page hidden link.

How should I solve this?

Luc

Instead, I got:

Steps to duplicate the issue:

January 16, 2017 at 2:13 pm #1183047

Sumit
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hi,

Thank you for contacting support forum.

As I can see right now accessing any URL like hidden link or hidden link shows me an English home page of the website.
So it is correct behavior. I am sorry but I don't understand this issue? Can you please let me know what do you expect?

About another search engine issue: Yes, that I can see. It might be because of you may have that URL structure in past. Right now WPML does not redirect from old URL structure to new structure. So in this case you need to place a permanent (301) redirect from ?/lang=nl to /nl and after some time search engines will update their indexing.

Please let me know your feedback!

Thanks

January 16, 2017 at 2:59 pm #1183102

almudenaN

Hi,

I would like to know how can I solve an URL error I found by analyzing my website on Search Console. The URL t affected shows "Error 404". This URL doens´t belong to any of the pages of my website, refers to the tags option. I have already got in touch with my Hosting and Theme support services and they told that the problem is because of the WPML settings. Which could be the problem? Could it happen because of the language format? How can I fix it?

This is the URL which has been affected: hidden link

I attached pictures

Thank you,

January 16, 2017 at 3:14 pm #1183117

lucM-5

Problem is that hidden link or hidden link do NOT correspond to the home page for English & Dutch language - they just give a blog inventory, which is not what corresponds to how the home page is defined. Correct home page can be found at hidden link & hidden link (dutch language).

I'm not aware that I ever had any other language structure on this site - but this may have been the case with previous version of the website (not built by me).

So I should define a 301 redirect from ?lang=nl to /nl ? I tried this yesterday, but it seemed to redirect to / instead of /nl. Is this the correct syntax

?lang=nl to /nl

or should it be

?/lang=nl to /nl as you indicate in your reply?

Finally, I'm not sure why another support thread is entered in this thread.

Thanks,

Luc

January 17, 2017 at 9:16 am #1183614

Sumit
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hi Luc,

I am sorry that was a typo. It should be /?lang=nl to /nl
How did you place the redirect using some plugin, htaccess, php or server? Please share the code so I can find why it is not working.

Right now I can not see hidden link or hidden link if it is showing blog page then it is completely wrong in my opinion. I will test this and forward to the team then I will let you know.

Hi @almudenan would you mind to start a new thread for this issue so we can help you better and quickly?

Thanks

January 17, 2017 at 10:40 am #1183733

lucM-5

Hi, Sumit

In the meantime, I've defined redirect from hidden link and hidden link to hidden link - because we don't want to show the blog page at this location, we want the actual home page. Redirection of hidden link to hidden link didn't seem to work - it kept going to hidden link.

The reason for this seemed to be that hidden link was an English language page - it showed english language menu. That's something that really puzzles me. I wonder if you know of similar cases reported to support?

Regards,

Luc

January 17, 2017 at 12:17 pm #1183826

Sumit
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hi Luc,

No that should not be a problem. When default URL structure is disabled it should have no effect on the page. That's why accessing /?lang=nl showing you default language.
Please let me know how you are setting up a redirect?

Thanks

January 17, 2017 at 12:31 pm #1183850

lucM-5

I am using Yoast SEO plugin to define redirects in WP backend

January 17, 2017 at 12:59 pm #1183868

Sumit
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hi Luc,

Please remove those redirects and place below code in functions.php file

function wpml_custom_default_query_str_rdr() {
    if( !empty($_GET['lang']) ) {
        $active_langs = apply_filters( 'wpml_active_languages', '');
        $default_lang = strtolower(apply_filters( 'wpml_default_language', '' ));
        $requested_lang = strtolower($_GET['lang']);
        
        if (is_array($active_langs) && !empty($active_langs)) {
            foreach ($active_langs as $lang_code => $lang_details) {
                $lang_code = strtolower($lang_code);
                if ($requested_lang == $default_lang) { 
                    wp_redirect( home_url(), 301 );
                    exit();
                } else if ($requested_lang == $lang_code) {
                    wp_redirect( home_url('/') . $lang_code, 301 );
                    exit();
                }
            }
        }
        
    }
}
add_action( 'template_redirect', 'wpml_custom_default_query_str_rdr' );

And let me know does it works for you?

Thanks

January 17, 2017 at 2:02 pm #1183959

lucM-5

Thanks, I will try later today & keep you posted on the results

Luc

January 17, 2017 at 3:29 pm #1184070

Sumit
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hi,

No problem! I will wait for your feedback.

About another issue "hidden link showing blog entries" has been escalated to our developers already and they are working on it. I will keep you posted about the status of this issue.

Thanks

January 25, 2017 at 10:35 am #1190266

lucM-5

Hi, I though I had already replied before. Just to let you know this script solved the issue

Luc