Skip to content Skip to sidebar

This thread is resolved. Here is a description of the problem and solution.

Problem:
If you're experiencing issues where the 'My Account > My Courses' page only works in English and redirects to the 'My Account' page in other languages, it might be due to incorrect URL handling in your custom theme.
Solution:
We recommend checking the

functions.php

file in your theme. Specifically, look for the function that customizes the WooCommerce menu on the 'My Account' page. You might find that the URL is hardcoded to 'my-account/my-courses', which does not account for language variations. Replace:

echo esc_url( home_url( 'my-account/my-courses' ) );

with:

echo wc_get_account_endpoint_url( 'my-courses' );

This change should correct the URL to reflect the appropriate language-specific endpoint. Please ensure to backup your database and website before making any changes.

If this solution does not resolve your issue, or if it seems outdated or irrelevant to your case, we highly recommend checking related known issues at https://wpml.org/known-issues/, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If further assistance is needed, please open a new support ticket at WPML support forum.

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

Last updated by markL-59 2 weeks, 1 day ago.

Assisted by: Long Nguyen.

Author Posts
March 28, 2026 at 8:53 pm #17934252

markL-59

The My Account > My Courses page only works in English. In all other languages, the My Courses page redirects to the My Account page.

March 30, 2026 at 7:01 am #17935163

Long Nguyen
WPML Supporter since 02/2022

Languages: English (English ) Vietnamese (Vietnamese )

Timezone: Asia/Ho_Chi_Minh (GMT+07:00)

Hi Mark,

I'm Long from the WPML Development team, I'm happy to help you with this issue.

To investigate the issue further, I would like to request temporary access (wp-admin and FTP) to your site so I can take a better look at the issue. It would be better to have a testing site where the issue is replicated. Your next reply is set to private to share the info.

❌ IMPORTANT: Please backup your database and website before proceeding ❌
You can use this plugin to create the backup: https://wordpress.org/plugins/duplicator/

Looking forward to your reply.
Thanks

April 2, 2026 at 2:59 am #17944677

Long Nguyen
WPML Supporter since 02/2022

Languages: English (English ) Vietnamese (Vietnamese )

Timezone: Asia/Ho_Chi_Minh (GMT+07:00)

Hi,

After investigating the issue, I see that:

1. If I visit the My Account > My Courses page in English and switch to a second language, it shows the correct translation of the My Courses page and URL:

- English: hidden link
- German: hidden link

Please check the attached screenshot.

2. If I click on My Courses in the left menu sidebar, it redirects to the My Account page because of the wrong URL
- German: hidden link

I go to the admin area and see you are using a custom theme to customize the WooCommerce menu on the My Account page. Edit the file functions.php in the theme "Weavers Web Theme", I notice the function on lines 758-847 has the code

<a class="nav-link <?php echo is_wc_endpoint_url('my-courses') ? 'active' : ''; ?>"
   href="<?php echo esc_url( home_url( 'my-account/my-courses' ) ); ?>">
    <img src="<?php echo get_template_directory_uri();?>/images/course.svg" alt="">
    <span><?php echo __('My Courses', 'woocommerce' ); ?></span>
</a>

which displays the slug "my-account" in all languages instead of its translation "mein-konto-3".

I suggest you replace the code:

echo esc_url( home_url( 'my-account/my-courses' ) );

with the code below and recheck the issue.

echo wc_get_account_endpoint_url( 'my-courses' );

❌ IMPORTANT: Please backup your database and website before proceeding ❌

Looking forward to your reply.
Thanks

Screenshot 2026-04-02 at 09.24.41 2026-04-02 09-25-12.png
April 2, 2026 at 11:20 pm #17947066

markL-59

Thank you, that seems to have fixed the issue!!