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.
Sun | Mon | Tue | Wed | Thu | Fri | Sat |
---|---|---|---|---|---|---|
- | 8:00 – 12:00 | 8:00 – 12:00 | 8:00 – 12:00 | 8:00 – 12:00 | 8:00 – 12:00 | - |
- | 12:00 – 16:00 | 12:00 – 16:00 | 12:00 – 16:00 | 12:00 – 16:00 | 12:00 – 16:00 | - |
Supporter timezone: Europe/Zagreb (GMT+01:00)
Tagged: Custom Work
This topic contains 10 replies, has 1 voice.
Last updated by Dražen 1 day, 15 hours ago.
Assisted by: Dražen.
Author | Posts |
---|---|
January 16, 2025 at 11:25 am #16601638 | |
amigosS |
Background of the issue: Symptoms: Questions: |
January 16, 2025 at 2:05 pm #16602380 | |
amigosS |
Quick addition : I stored in a var all the links separated by comas and displayed them in an html commented line before the rendered html and all of them are in the current language but the html code that is displayed has all its linked changed back to original language. WPML is 'fixing' the links using a wordpress hook somewhere. I need to prevent this action and be sure wpml doesn't change any link. |
January 21, 2025 at 8:32 am #16616730 | |
Dražen Supporter
Languages: English (English ) Timezone: Europe/Zagreb (GMT+01:00) |
Hello, thanks for contacting us. You can try to use the wpml_sl_blacklist_requests flter and then re-translate page, and it should not adjust the slugs in 2nd language: But since you are using custom code I am not sure if this will work, you can also try switching to manual translation mode and manually adjust the 2nd language links to what you need: https://wpml.org/documentation/translating-your-contents/using-different-translation-editors-for-different-pages/ Or if nothing helps, hiring a WPML contractors to adjust your code and make it work correctly in 2nd language links also: - https://wpml.org/contractors/ I hope this helps, let me know how it goes. Regards, |
January 22, 2025 at 2:01 pm #16623493 | |
amigosS |
Hello, can you be more precise on this snippet please ? To explain in better : Your solution seems to be the one we're looking for but we don't know what to put as $blacklist[] value. Can you help us on that ? (our brands url are : site.com/brand/the-brand-slug/ About the custom code : in these same pages, we call a shortcode that lists all the brands. To avoid long query when we charge the pages (as we want to make sure brands are not empty), we have a daily cron that writes all non-empty brands in a file, then the shortcode gets the content and displays it on our website. We tried to save all the links in a var and display it, it displays all the translated links for each pages but the displayed content of the shortcode itself is re-modified by wpml to the original version of the links. I think your solution could help us on that too. Thank you |
January 22, 2025 at 2:24 pm #16623675 | |
Dražen Supporter
Languages: English (English ) Timezone: Europe/Zagreb (GMT+01:00) |
Hello, I think I misunderstood the issue, I understood you want to keep it in the default language, but you actually wish to add a translated brend URL, correct? If so, I have just tried you case and it seems to work fine in the test site, 2nd language not the translatable taxonomy URL stays the same, and WPML is not forcing the default language. - hidden link I suspect this could be an issue with your custom code or some additional plugin. Would it be possible for you to confirm this issue still happens with the default theme and only WPML plugins and Elementor? We can also try it in the slider and on a regular page with text, to check what might be causing it. Please try to reproduce the same issue in a simple example on this new test website: - hidden link Regards, |
January 22, 2025 at 6:10 pm #16624783 | |
amigosS |
Hello, sorry. The issue is concerning woocommerce products' attributes. I can't try it without woocommerce plugin. Here's how to reproduce it : The attribute has to exist before ! (I tried writing a fake link : hidden link and I can see that it outputs "correctly" (since it doesn't exists it is filtered I think but like that : hidden link). I need wpml to just not filter urls by checking if they are good or not. Let me know if you still see hidden link in the href of the translated version of the page. |
January 23, 2025 at 7:41 am #16625796 | |
Dražen Supporter
Languages: English (English ) Timezone: Europe/Zagreb (GMT+01:00) |
Hello, okay, I tried to create the Cars attribute, since there is already taxonomy Brands from Wocommerce default. But I can not get an attribute archive link to exist. This does not work even without WPML: hidden link Can you please check and try to reproduce the issue: - hidden link Regards, |
January 28, 2025 at 3:24 pm #16642824 | |
amigosS |
Hello, First, I could create brand attribute as I changed the slug in permalinks beforehand. So : I created a test page ( hidden link ) and its translated version ( hidden link ) Which brought two things : 2- I think I know why it's not working on our website, it's because of a previous issue we had and I saw that many people had issues with cache ( https://wpml.org/forums/topic/object-cache-issues/ ). It's maybe because of our object cache. We are using APCu (not redis that we tried and isn't as good for us) and we discovered that when we shut down the cache, many links work better than when we activate the plugin. We tried many object cache plugins and system (redis as said previously) . In our previous tickets, someone from wpml sent me a plugin that works with cache plugins but it didn't really help. But what is weird also is the same issue with our custom shortcode. As I said, we list all the links. I store them in a var and list them in some html that is called by the elementor page. What is weird is that if I display the content of the var (so just url in text format separated by comas), all links appear translated in all languages. But the html output called by elementor has the same error as the widgets, it edits the links back to their original version. |
January 29, 2025 at 7:23 am #16644469 | |
Dražen Supporter
Languages: English (English ) Timezone: Europe/Zagreb (GMT+01:00) |
Hello, thanks for getting back. As for the object cache, yes there are some issues with it and we advise disabling it why do you do the translation and work with WPML as it can cause issues, once you finish the translation you can enable it back to avoid issues. Please note I also do not see any mention of APCU, we only have Redis / object cache plugin in our compatibility list and have provided some workaround to exclude certain parts and it helps some clients. You can try to check with APC support / hosting if there is such things and try to exclude some parts from caching like Wocommerce, WPML, translations and etc. But the best would be to keep it disabled when you do the translations. Regards, |
January 31, 2025 at 11:24 am #16655147 | |
amigosS |
Hello, I don't have any plugin linked to this. And the craziest part is with the shortcode (that lists all the brands attributes with at least one product in it).. It just makes no sense. As I said, if I store all the links in a var and display it as an html comment with all the link separated by comas, all the links are translated. But when I display the html (that generates a slider of all these brands), it turns all the link to original ones.. It looks like the issue happens only on rewrote (rewrited ?) links. |
January 31, 2025 at 11:37 am #16655186 | |
Dražen Supporter
Languages: English (English ) Timezone: Europe/Zagreb (GMT+01:00) |
Hello, I am afraid, as I have said before, we can not help with custom code issues. For custom code solutions you can hire WPML contractors: https://wpml.org/contractors/ If you can show me the issue/ WPML bug on the test site I provided, I can further have a look and see what is wrong. Other than that the best I can do is offer to debug your staging website, but in conditions without custom code and custom themes/plugins, and probably would need to disable some plugins to see if any conflicts with link and etc, not sure if this is helpful for your case since it involves custom code/shortcode. Let me know. Thanks, |