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

Last updated by stevenM-21 2 years, 7 months ago.

Assigned support staff: Bruno.

Author Posts
October 18, 2018 at 4:39 pm #2828849



When we we type in our business name in Google we get an indexed url that is pointing to an index of demo posts instead of our index page. This is only occuring since we started using WPML.

The indexed URL is hidden link and should be hidden link


October 19, 2018 at 10:11 pm #2833136


Hello there,

Thank you for contacting us. Please, my sincere apologies for the delay in answering.

This looks like because initially, your site was using the URL format as a parameter, Google has indexed this page and has not yet updated.

You should use some plugin or some custom code to redirect the page when using the lang parameter. For example, in the file functions.php of your theme, after line 2, you can use this function:

add_action( 'template_redirect', function() {
	$lang = isset( $_GET['lang'] ) ? sanitize_key( $_GET['lang'] ) : false;
	if( ! empty( $lang ) ) {
		wp_redirect( get_site_url() . "/" . $lang . "/", 301 );

Basically, this code will check if there is any lang parameter in the URL. If so, this will definitely redirect (code 301) to the URL format as "/nl/".

Note that it is necessary for Google to re-index your site and then update Google's internal records. For this, it is only necessary to wait.

Please, let me know if I can help with any other questions you may have. I'll be happy to help.

Thank you.

October 23, 2018 at 11:52 am #2842181


Dear Bruno,

Thanks for your help. We have added the code on top of functions.php but as you will see by surfing to hidden link it still displays our latest posts instead of our frontpage.

We are getting a lot of problems with our website since we started using the paid version of WPML. For example it keeps showing old versions of the following pages although we have disabled wprocket, cdn and cloudflare:

hidden link: shows old menu without demo button
hidden link: shows old menu without language switcher
hidden link: shows correct menu

Please help us out as this nog making us look good.


October 23, 2018 at 6:52 pm #2843908


Thank you for the feedback. I noticed you are using a cache plugin. Have you tried clearing the cache to see if the problem persists?

Also, have you added the above code inside the functions.php file of your theme/child-theme?

About the other issues you are reporting if the problem persists, may I kindly ask you please to open a new ticket for your new question? This will also help other users with similar problems find solutions when searching the forum.

Thank you.

October 31, 2018 at 8:42 pm #2867464


My issue is resolved now. Thank you!