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.

Sun Mon Tue Wed Thu Fri Sat
- 8:00 – 10:00 8:00 – 10:00 8:00 – 13:00 8:00 – 13:00 9:00 – 13:00 -
- 11:00 – 17:00 11:00 – 17:00 14:00 – 17:00 13:00 – 17:00 13:00 – 18:00 -

Supporter timezone: America/New_York (GMT-05:00)

Tagged: 

This topic contains 40 replies, has 3 voices.

Last updated by Lauren 1 month, 1 week ago.

Assisted by: Lauren.

Author Posts
November 30, 2023 at 3:37 pm #14964835

bradC-7

Good morning, I asked this in response to another user's question yesterday but am also starting the conversation here. Is there a "best practices" guide on how to handle links?

I have the pages linked to their respective english content within the website and previously would link to "/about/" translated to "/fr/a-propos/" where the website was automatically adding the "/fr/" portion and in the advanced translation editor, all that appeared for my translator in that field would have been "/about/" which they would have entered "/a-propos/".

Now it seems that the "/fr/" is being dropped but instead of getting 404 errors, the links open the english pages instead of the french ones.

This link which was given to the other user seems to suggest that they need to be manually set using the format chose:
https://wpml.org/faq/how-to-translate-urls-shortcodes-and-html-attributes-using-the-advanced-translation-editor/#how-do-i-translate-urls-with-the-advanced-translation-editor

I would have thought that it best to leave the "/fr/" which is a higher level plugin option, rather than encode that format into every single internal link.

Another possibility is that it might be a bug, as the situation above was working correctly (in advanced translation editor, "/about/" is translated to "/a-propos/" but the actual link must be "/fr/a-propos/" for the link to work) but suddenly links to the english pages. Again, this example case was linking to the french page before, but suddenly behaves differently.

Website is in maintenance mode but I can share temporary credentials.

Thank you,
Brad

December 1, 2023 at 1:30 pm #14973153

Laura
Supporter

Languages: English (English ) Italian (Italiano )

Timezone: Europe/Rome (GMT+01:00)

Hi,

thanks for contacting us.

You should never manually add the language directory to your links, WPML adds it automatically. If it doesn't happen we need to check why.

As the first thing you should increase the WP Memory Limit https://wpml.org/faq/checklist-before-opening-a-ticket-in-wpml-support/#how-can-i-increase-my-sites-memory-limit

Then please provide credentials and some example pages which have the issue

December 1, 2023 at 7:24 pm #14975425

Lauren
Supporter

Languages: English (English )

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

Hi Brad, I've reviewed the issue and logged and the issue comes from the fact that instead of pasting the full URL, you are only pasting the end slug. So, instead of pointing the icon to /about/what-we-do, you should point it to hidden link. I fixed that for the first icon to test and now when you open up the WPML translation editor, type http in the search at the top and you will see the full URL result, where you can then add the full translated link. I hope that clears things up, let me know if you have any further questions.

December 1, 2023 at 9:29 pm #14976307

bradC-7

Thank you so much for taking a look! Really appreciate your help!!

I've gone through the home page as a test and reformatted the links to include the full URL. The issue I am running into is that these same links are not appearing in the translation editor. For example, there is a grid of various technical resources roughly half way down the page where each tile has been updated with the correct link format, yet it doesn't appear in the editor for the translator to confirm. The links are still directing to the english (initial/defaut) language versions of the pages and I don't see how to deal with that. If they were in the editor then the way I see going forward is for me to first crawl through and update every link, before my translator then updates all the translations making the appropriate link translations.

Thanks again for the support! You found the issue, I just need some help fixing it 🙂

December 4, 2023 at 1:40 pm #14987401

bradC-7

Good morning, not wanting to send too many requests but wondering about an update to this. Thanks in advance!

December 4, 2023 at 3:37 pm #14988791

Lauren
Supporter

Languages: English (English )

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

I'm not sure which section specifically you are referring to, but I checked the section with the fancy boxes. If you open up the translation using the advanced translatin editor and type http into the search box at the top, you will see lots of links that don't have translations yet, including the links for those fancy boxes. I have attached a screenshot. if there is a link that you don't see when using the search, please let me know specifically which section of the page and which link and I'll be happy to look further into it.

Screenshot 2023-12-04 at 10.36.22 AM.png
December 4, 2023 at 4:18 pm #14989371

bradC-7

Really appreciate the follow-up and especially your patience!!! I realize I'm struggling here so thanks again for the help!

Sure enough, these fields do not appear on the page BUT when searching these fields are appearing. I assumed search works as a way to filter the longer list but I guess the advanced translator doesn't show everything (?). Is there a way to make all these invisible but searchable fields visible? Thanks again for the hand-holding here.

So if I go through, I can have my translator have a tab listing the pages in French, then they go back and copy the entire URL?

Reading through other topics, I thought I was being prudent by entering my links which excluded the language directory was not included (what if we want to change the format later?):
https://wpml.org/forums/topic/internal-links-in-page-are-not-translated-automatically/

For what it's worth, these relative internal links were translating for the entire development process until shortly before posting this ticket. Before I go through the work of replacing all these links to include the language directory, I wanted to confirm to double/triple check as it seems to conflict with what Laura said earlier, as well as what I've seen elsewhere. It really does seem to me like something else is going on here.

Is there an area of the official documentation that addresses this question (how to "properly" set up internal links for translation)? I like to think I'm doing my due diligence here, and will shift to checking the video material.

THANKS AGAIN, cant say enough how much I appreciate the help.
Brad

December 4, 2023 at 5:08 pm #14990205

bradC-7

Just following up to keep all my information together. I know spamming isn't helpful but trying to save you time.

According to this: https://wpml.org/announcements/2020/02/translating-links-with-advanced-translation-editor/ it was a deliberate decision for having to search for URL's and other information. This was on purpose to keep the interface clean for translators which makes sense to me - and noted for future Brad 🙂

According to this: https://wpml.org/forums/topic/internal-links-within-translated-page/ I am seeing agreement with what you said earlier, where the links should be full URLs.

Here is the relevant snippet from Carlos from that ticket:
In order to work, the automatic link translation must meet these two characteristics:
- The links must be full URLs, which means that a link like /contact won't be automatically translated, but hidden link will be translated
- Also, the link must point to a translated content, so continuing with the example above, the 'Contact' post/page must be translated too

And, according to this: https://wpml.org/forums/topic/internal-links-4/ I can use this tool scan and repoint broken links. I'll try using this tool once I've tested another page.

Looking at your screenshot, I'm wondering why these links aren't getting translated automatically? They are in the full URL format and are pointing to pages that have translations available in the same language (French page linking to a page with an available French translation). If I go through and manually add the links, this also means that I will be entering in the language directory ("/fr/") for each of these where I'm inclined to prefer to let the "automatic link translation" function from the devs work its magic.

Thanks again! Sorry for the headashes

December 4, 2023 at 6:04 pm #14990401

Lauren
Supporter

Languages: English (English )

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

I suggest trying the option to translate links using the button in WPML -> Settings to update link targets. However, some page builder elements do not have the URL field registered for translation, and if that is the case, the transalte link targets probably won't work. If that happens, then we can try to force register the page builder shortcode link using the custom XML configuration.

Please let me know the results after you run that update and if that works to translate the links. To follow up on your previous reply, although it looks like you already found the documentation, it is intentional that the links are hidden from the ATE interface. One, to keep it cleaner, and then the other reason, if using automatic translation, if there are outside links it could break the URL if machine translation translates the URL incorrectly. I hope that makes sense! Let me know how it goes and we'll continue troubleshooting here if needed.

December 5, 2023 at 1:48 pm #14998377

bradC-7

Thanks for the follow-up!

I ran the tool and it detected 36 links that were repaired. Hope page links are still working but pointing to the English pages.

After watching a couple of videos (some by WPML and some my others) I think I have a better understanding of the intention of this feature, and why we might want to link to different URLs depending on the translation (sun vs sol was the example video which makes sense to me). It also doesn't seem to apply to my main use case for nearly all of my links as they are all internal references to toner locations within my website.

That being said, I still have links that are not recognized in addition to now having some more that I clicked on which I want to remove translations for. I try clearing out the input field but the interface will not let me enter in a blank entry (I want to leave these properly formatted URL's for the automatic translation service and not have them hard-coded manually with the language directory included). See attached on the home page for my example. I realize this is a fairly basic question so again, thank you for being so patient.

I still have some links that would have appeared not as automatic URLs but were relative internal links which after updating to include the full correct French location (*with language directory included in the link) are showing up as strings in the main view. Is there anyway to have these strings handled like the other URLs, now that they are conventional internal links?

For the others (that I have not touched yet where there is still an optional "+"), why aren't these being handled automatically in the correct way? I believe that I satisfy the conditions for automatic translation to handle these on it's own. Are you able to offer any insight or help me out on these other examples (links No. 2, 3, 4 and 5 in the screenshot)?

I suspect that this is what you were getting at with the custom configuration since the links not working are not simple linked text through the WP visual editor (those ones ARE working) and are elements placed using WP Bakery that came with my salient theme (Themenectar is the developer which I suspect is why I see "nectar" everywhere in the ATE). Again though, I swear we had these working early on and only recently we ran into issues... Screenshot 2 shows the editor view where I have added the full URL, and screenshot 3 includes the refreshed French version of the page where my cursor is hovering and showing the English URL. This is near the end of the home page if you are looking for this area - admin credentials shared are still valid.

Basically, my questions are now:
1. How can I fix or "undo" my activating of some of the URL fields in the ATE to revert them back to be automatically handled?
2. Any ideas or insights into why the properly formatted links aren't getting identified and translated? I think this is the root issue.
3. What are some other things I can look at?

Thanks again, and sorry for taking so much of your time on this.

Sincerely,
Brad

WPML-support-links-how to remove.png
WPML-support-links-checking the research selection.png
WPML-support-links-checking the research selection-2.png
December 5, 2023 at 4:19 pm #15000845

bradC-7

Just as an update in case someone is taking a look, I think I've figured out exactly what I need to do with the exception of any links where my translator activated the URL field and can't revert the field back to being handled automatically.

I think this is a bug/oversight for a typical use-case so would appreciate any comment or guidance on this.

In the meantime, I'm crawling through my other pages and changing the link format. I did confirm with my translator that the links using relative paths WERE working but that could have been totally by accident or coincidence where some other minor update to WordPress,theme , plugin like WPBakery etc, made a minor change where our happy coincidence broke. In any case, I'd like to request for the sake of other users in a similar position to accommodate these types of paths if possible.

I tested some other translatable elements like slider slides or shortcodes and have confirmed that when I comb through, change the format, have the translator approve the translated version (where the links are hidden from him as discussed earlier), then run the "Translate link targets" scan tool, these are found and "reconnected", reflecting correctly on the translated pages without having to specify a language directory in the translation editor.

I will keep updating other pages but would appreciate an update on the home page in particular as WE ARE LAUNCHING TODAY (early afternoon Toronto time) so this whole last-minute curve ball hasn't been ideal to say the least. All of our other technical content has been otherwise translated and tested, ready to go. This is time-critical for me but I realize there is only so much I can do in my situation.

In any case your assistance is appreciate and especially your patience!

Thanks again,
Brad

December 5, 2023 at 5:38 pm #15001673

Lauren
Supporter

Languages: English (English )

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

Hi there, glad we are making some progress. You mentioned in your previous reply that you still had some links that were not recognized. Can you tell me specifically which links you are referring to on the homepage? A screenshot will help me to easlily understand which ones you are looking for. As for removing links from the advnaced translation editor,it is not possible to leave a blank field. You can simply copy the URL of the original link if you don't want it translated and paste it in the translation field. I hope I am understanding that correcly, but if not, please let me know.

December 5, 2023 at 6:40 pm #15001987

bradC-7

Haha yes agreed, we are getting there. Thanks again for the help!

I went to retake screenshots and am now seeing blanks next to the URLs.

Will keep you posted. Was this anything I did? I swear I JUST saw them listed in the main ATE interface and now they are recognized as links. Oddly enough when I ran the scan tool (see attached), none were identified unless you or someone else on your team ran it just before.

That being said, I am still not seeing the language directory inserted into my URLs on the front end (see attached). It's still not working and I've tried clearing all my browser data to rule out any caching.

If I understand, you are saying that having the same link works the same as a blank field where the website handles it that way? Good to know!

I'm still not sure why it isn't working but again, incremental progress...

Thanks again!
Brad

WPML-support-links-checking the research selection-3-frontend.png
WPML-support-links-checking the research selection-3-link scan tool.png
December 5, 2023 at 7:21 pm #15002411

bradC-7

Just chiming in again to address my poor reading comprehension skills. I now am on the same page on: "You can simply copy the URL of the original link if you don't want it translated and paste it in the translation field."

THANK YOU again for your infinite patience...

I'll keep an eye to see what else you can find or recommend 🙂

December 5, 2023 at 7:42 pm #15002457

Lauren
Supporter

Languages: English (English )

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

I have not run any scans on your site, and as far as I know, I'm the only one currently working on the site from our end. One thing to note is that the option to translate link targets often does NOT work for links added via page builder content. Those types of links generally need to be translated in the translation editor by typing http in the Advanced Translation Editor search field. I checked the content for the screenshot that you shared and can see that these links have not been translated in the Advanced Editor. See my attached screenshot. Once you enter the translated link there it should work as expected.

Screenshot 2023-12-05 at 2.41.50 PM.png

The topic ‘[Closed] "Best Practice" guidance on internal links’ is closed to new replies.