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

Last updated by Andreas W. 3 months, 2 weeks ago.

Assigned support staff: Andreas W..

Author Posts
June 20, 2019 at 12:53 pm #4060069

Michael

Hello,

I am trying to:

from the English or Spanish version of a page, I am trying to use the footer or header switcher to reach the translated page, but the links are incorrects.

More explanations:
The plug-in is well installed and I was able to add some translations to my blog.
I have two types of post:
- normal post with links: discoverwalks.com/blog/a-title/
- a custom post type named "article" with subfolders with a city name: discoverwalks/blog/paris/a-title/

For the normal post, it works fine. On the English (default language) page, I can switch to the Spanish version and it's pointing to the right page. But for the other "article" CPT, it's pointing to wrong pages.

Link to a page where the issue can be seen:
English original page: hidden link

Spanish version: hidden link

I expected to see:
hidden link should point to the Spanish version: hidden link when clicking on the Spanish flag.

Instead, I got: hidden link to hidden link (which doesn't exist).

The header and footer switcher are not pointing to the right urls/slugs, hence leading to a 404 error.

Information that could be relevant: when I'm in the editing section of the post, I got the information in the WPML box that my Spanish version is the translation of the English version, so these two articles should be connected.

Thanks!

June 21, 2019 at 10:17 pm #4069377

Andreas W.
Supporter

Languages: English (English ) Spanish (Español ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

Hello,

Thank you for contacting the WPML Support Forum.

Please go to Settings -> Permalinks and simply click the "save" botton. Did this solve the issue? If not, try to save the permalink structure to a more complex pretty link, like "Name & Date" and save again.

If this will not solve the issue proceed as followed:

Could you please try to run the site in minimal setup to see if the issue persists?

Please disable any additional plugin that is not related to WPML and its add-ons. If the issue disappears please start reactivating any plugins, or activate them in small groups. This way please verify at which points the issue appears again to indicate the plugin that is causing the issue.

Also please change to a default theme like TwentySeventeen to see if the issue might be theme related.

Further, you could enable the wp-debug feature to see if there are any current PHP errors given.

Add the following to your wp-config.php file:

define('WP_DEBUG', true);
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );

The wp-config.php is located in your WordPress root directory. It’s the same file where the database configuration settings are. You will have to access it by FTP or SFTP in order to edit it.

If you open wp-config.php and that define statement is not there, you can add it right before this line:

/* That's all, stop editing! Happy blogging. */

You will be able to find a complete report inside of your wp-content folder. Look for a debug.log file and provide me the results.

More information about how to activate this feature you can find here:
https://wpml.org/documentation/support/debugging-wpml/

Kind regards
Andreas

June 26, 2019 at 11:32 am #4092107

Michael

Hello,
Thanks for you answer.
I tried to valid again the permalinks without doing nothing and it didn't work.
I also tried to add a variable in the permalinks but nothing happened.

I have around 60 plug-ins activated so disabling all of them would certainly cause issue (even temporarily) on my blog, do you have any advice for this?

however, I have the log file available, how can I send it to you?

Thanks,
Michael

June 26, 2019 at 4:26 pm #4094055

Andreas W.
Supporter

Languages: English (English ) Spanish (Español ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

Hello,

I would like to request temporary access (wp-admin and FTP) to your site to take a better look at the issue. It would be better to a testing site where the issue is replicated.

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.

Maybe I'll need to replicate your site locally. For this, I’ll need to temporarily install a plugin called “Duplicator” on your site. This will allow me to create a copy of your site and your content. Once the problem is resolved I will delete the local site. Let me know if this is ok with you.

IMPORTANT

Please make a backup of site files and database before providing us access.
If you do not see the wp-admin/FTP fields this means your post & website login details will be made PUBLIC. DO NOT post your website details unless you see the required wp-admin/FTP fields. If you do not, please ask me to enable the private box. The private box looks like this:
hidden link

Kind regards
Andreas

June 27, 2019 at 6:24 pm #4102083

Andreas W.
Supporter

Languages: English (English ) Spanish (Español ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

Hello,

As far I can see the language switcher do behave as expected.

As example the article hidden link has not been translated yet.

Make sure to complete the translations and the language switcher should work.

I would advise you to enable the WPML Translation Editor in order to translate the content. You can find the option inside of each page, post, article editor page in the right sidebar under "Language".

Let me know if this solved the issue.

Kind regards
Andreas

June 28, 2019 at 10:06 am #4106401

Michael

Hello,
Thank you for your answer.

As you can see in the example you showed me, I had the Spanish (but not completed) - but not the other languages - which shouldn't be a problem because it's working for classic "post". Hence, I completed the Spanish version to 100% but the link is still not the correct one.

When, I'm on the English version and I use the Spanish switcher, it doesn't go send to the right url.
You can try here:
hidden link

click on the top switcher to Spanish, and it will try to connect to hidden link which is a 404 error.
The right page it should reach is:
hidden link

Thank your for your help!

June 28, 2019 at 2:49 pm #4108681

Andreas W.
Supporter

Languages: English (English ) Spanish (Español ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

Hello,

Indeed, the menu language switcher does show a wrong slug while the language switche rin the footer shows the correct slug for the posts but it is not including the language directory for Spain. None of both options do lead to the correct post.

As I mentioned earlier this issue might be related to a plugin incomaptibility or it is a theme issue. It might be even very possbile that the issue is theme related.

We could make a quick test, if you could add the theme to the following test site and I will test it on short time.

One Click Login: hidden link

Leave me a short notification once the theme is installed.

We have further a few options. I could test directly on you live site by disabling plugins and changing the theme or I could take a duplicator package and procceed with those test on localhost, but this would take a bigger amount of time.

Could you make a backup of your site and data base and I could test directly on the live site or do you prefer that I take a copy and migrate it to my system?

Once we have identified what is causing the issue we can take further steps with our compatiblity team.

Kind regards
Andreas

July 8, 2019 at 9:18 am #4160497

Michael

Hello,
sorry for the late reply, I was on vacation..
Thanks a lot for your help. However, the theme link is not available anymore, can you send it to me again?
The best thing for us would be to duplicate the website on localhost, even if it takes more time...

thanks,
Michael

July 8, 2019 at 3:05 pm #4163887

Andreas W.
Supporter

Languages: English (English ) Spanish (Español ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

Hello,

Thank you for your message.

As far I can see the issue is solved as soon the plugin "Redirection" is disabled.

As this plugin should be compatible with WPML and there only some posts affected it seems to me that it could also be caused due to a misconfiguration of the plugin. I see you got various redirects activated.

Could you please test if one of those active redirects is having influence on the post?

Kind regards
Andreas

July 9, 2019 at 9:02 am #4168845

Michael

Hello,

Thank you for your answer. However...

I just saw that you changed my permalink structure, which is a big problem considering I have 1000+ blog posts with a clear structure:

it went from:

hidden link

to

hidden link

you made the change yesterday at 4.55pm, as I can see on my logs...

I had to rollback to my old structure /blog/sample-post/ and I will check that everything is in order

thanks,
Michael

July 9, 2019 at 2:16 pm #4171743

Andreas W.
Supporter

Languages: English (English ) Spanish (Español ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

Hello,

Indeed, it is considered as best practive to use a "pretty links" permalink structure when using language in directory for the URLs. This would refer to any structure that is not "name" or "plain", in order to form a more complex URL.

In this case I was only testing and my appologies for not setting the option back to default. It should not have any influence on your site content.

Were you able to figure out why the Plugin Redirection is causing the issue? Is there maybe something misconfigured?

The plugin should be compatible, but we might investigate the issue further on the following test site. Please add your theme and any plugin realtive to create the content. It would also a huge help if you find a few minutes to recreate the issue in simple manner.

One Click Login: hidden link

Sorry, but the old test site sadly expired in the meantime.

Let me know about the outcome.

Kind regards
Andreas