Skip to content Skip to sidebar

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
- - 9:00 – 18:00 9:00 – 18:00 9:00 – 18:00 9:00 – 18:00 9:00 – 18:00
- - - - - - -

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

This topic contains 11 replies, has 1 voice.

Last updated by Andreas W. 6 days, 15 hours ago.

Assisted by: Andreas W..

Author Posts
October 22, 2025 at 4:33 pm #17509219

josephN-9

Background of the issue:
I am trying to translate an author page on my website. Here is a customer/author: hidden link. I want the page to display correctly in different languages. It works in Arabic: hidden link, but for other languages, it redirects to the homepage instead of the correct author page, such as hidden link and hidden link. The issue can be seen here: hidden link.

Symptoms:
When I try to navigate the author page based on language, it sometimes redirects to the homepage instead of the correct author page. I expected it to show news based on the author's language, but instead, I got redirected to the homepage.

Questions:
Why does the author page redirect to the homepage for certain languages?
How can I ensure the author page displays correctly in all languages?

October 23, 2025 at 7:58 am #17511238

Dražen
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+02:00)

Hello,

Thanks for contacting us.

While you wait for my colleague to take over the ticket, let me try to help you with the issue quickly.

Make sure post exist for that language for that author, if there is no post in EN then WordPress does not create author page. In short, make sure you have translated posts from this author to other languages also.

Regards,
Drazen

October 24, 2025 at 4:25 am #17514453

josephN-9

But it seems it is not like that as you explained:
For example this one user:

hidden link
This one user doesn't have any arabic article that's why it shows a "blank template" that this "Opps there is nothing"

hidden link
here is english template that user hase article it the article showsa as usual.

So I meant it should works as usual, if user has article then shows as usual:
hidden link

if not has any article it should show like that "Oops! Nothing here"-
hidden link

hidden link

But another issue is-

If you first visit ar - hidden link
then It allow to go english version from header languge button :
hidden link

but if you first visit eng: hidden link

it not allow to go arabic from header language dropdown:
hidden link

why ?

October 24, 2025 at 10:35 pm #17517951

Andreas W.
WPML Supporter since 12/2018

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

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

Hello,

Thank you for the provided details!

The redirect works from
hidden link
to
hidden link
as there are existing Arabic posts.

This page does not yet have any posts:
hidden link

I suggest you first translate the posts and then test again.

If you still run into language switcher redirect issues after all posts have been published in all languages, we can take further steps from there.

Best regards
Andreas

October 25, 2025 at 3:42 am #17518086

josephN-9

Hlw andreas,

I just wanted to ensure
if user has any posts then it show as usual :
hidden link

if user doesn't have any posts, It should show like that:
hidden link

"Opps nothing here...."

My question is- why it not works for other language ?

hidden link
hidden link
hidden link

I have many user who has only english article and will not have translated of them. and I manage my business like that if they want to translate they need to pay so most of the client has on language posts

October 25, 2025 at 7:33 pm #17518884

Andreas W.
WPML Supporter since 12/2018

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

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

Hello,

I created a test site using the Twenty Twenty-One Theme and WPML, and I can not confirm this issue.

In my example, the site's default language is English, and I have one post in German.

If I revise the author page in German, I see one post as expected, and there is no language switcher option, as the English author page has no posts:
hidden link

This means, on your site, it is unexpected that the WPML languages switcher offers a language option if the translated author page has no posts.

My test page:
hidden link

Now, the unexpected behavior on your site could be caused by the theme or by custom code used in your child theme.

Could you please install the latest version of the Foxiz Theme on the following test site, so that we can test if this issue if theme-related?

One-Click-Login:
hidden link

Leave me a comment on this ticket once you are done with this task.

Best regards
Andreas

October 26, 2025 at 4:04 am #17519039

josephN-9

I'm using latest Foxiz theme and relevant plugin.

I have few custom code on child theme and wp code plugin but they are not even related to wpml .

Even I have tested by remove my child theme code and decativate custom code plugin.
this didn't make any solution,

Please keep in mind, I have enabled this option:
-How to handle languages without translation :
Link to home of language for missing translations

may be that's why It redirect home page if user doesn't exist any posts but it should work for all user.

my concern is here :
it should behave one consistent way:
Either the author page generate for all user, if author doesn't have any posts then it shows:
hidden link

or Shouldn't generate author page who doesn't have any posts.

but here behaves unusual:

if user doesn't have any posts, It should show like that:
hidden link

"Opps nothing here...."

Below they are redirected to homepage

hidden link
hidden link
hidden link

I have tested your demo site

Screenshot(178).png
October 26, 2025 at 4:48 am #17519065

Andreas W.
WPML Supporter since 12/2018

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

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

Would it be possible for you to install the latest version of the Foxiz Theme on my sandbox, so that we can try to replicate the issue there and then take further steps?

One-Click-Login:
hidden link

If this is not possible, I can offer to take a closer look at your site as an admin user.

You can find the required fields below the comments section when you log in to leave the next reply. The information you provide is private, meaning only you and I can see and access it.

IMPORTANT
Please be sure to back up your website and database before granting us access.
If you can't see the "wp-admin / FTP" fields, your post and website credentials will be set to "PUBLIC." DO NOT publish the data unless you see the required wp-admin / FTP fields.

I may need to install a plugin called "All In One WP Migration" to create a copy of the website so I can investigate the issue further.

However, I would also be very grateful if you could provide a staging site or a copy of the website from your server for this purpose.

If you have any questions about creating such a staging site, you can consult your hosting provider. Please note that WPML must also be registered on this staging site at https://wpml.org/account/websites/.

If you are unable to provide such a copy of the website for testing, please let me know on this ticket.

The private reply form looks like this:
hidden link

Click "I still need assistance" the next time you reply.

Video:
hidden link

Please note that we are required to request this information individually on each ticket. We are not permitted to access any credentials that were not specifically submitted on this ticket in the private response form.

October 27, 2025 at 5:56 pm #17523260

josephN-9

Hello Andreas I have sent all credentials to you, Could you check my issue ?

October 28, 2025 at 9:39 am #17525276

Andreas W.
WPML Supporter since 12/2018

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

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

My apologies for the delay in answering.

As I mentioned earlier, on my test site, WPML will not display language options inside the language switcher if an author page has no posts.

In your case, you see a language option, as at WPML > Settings > Post Types Translation, the type "Posts" is set to "Translatable use translation if available or fallback to default language".

Your example author only has one post in Arabic:
hidden link

If I now use the language switcher on this page to switch to another language, I will always land on the respective homepage.

This is expected as long as the archive has no posts.

You can use this hook to solve this issue:
https://wpml.org/wpml-hook/icl_ls_languages/

Example for placing into your Code Snippets plugin:

add_filter( 'icl_ls_languages', 'wpml_author_switcher_fix', 10, 1 );

function wpml_author_switcher_fix( $languages ) {
    if ( is_author() ) {
        $author = get_queried_object();
        $author_slug = $author->user_nicename;

        foreach ( $languages as $lang_code => &$lang ) {
            // Build the correct URL using the current domain and language slug
            $lang['url'] = '/' . $lang_code . '/author/' . $author_slug . '/';
        }
    }
    return $languages;
}

What This Does
- Overrides the default switcher URLs on author pages.

- Forces each language switcher link to resolve to the author archive, even if no posts exist in that language.

- Prevents redirection to the homepage (which happens when WPML suppresses empty archives).

October 28, 2025 at 5:34 pm #17527281

josephN-9

Hello andreas,
Thank you for your help.

still need a small help:
if I'm here:
hidden link

and now I want to switch english by languge switcher, it gets this link :
hidden link

but it should get exactly below since my default language is "english" :
hidden link

means without /en/

with /en/ it gets 404 page error.

October 29, 2025 at 5:09 am #17527886

Andreas W.
WPML Supporter since 12/2018

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

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

Absolutely, sorry about that!

Please try this:

add_filter( 'icl_ls_languages', 'wpml_author_switcher_fix', 10, 1 );

function wpml_author_switcher_fix( $languages ) {
    if ( is_author() ) {
        $author = get_queried_object();
        $author_slug = $author->user_nicename;
        $default_lang = apply_filters( 'wpml_default_language', null );

        foreach ( $languages as $lang_code => &$lang ) {
            if ( $lang_code === $default_lang ) {
                // No language prefix for default language
                $lang['url'] = '/author/' . $author_slug . '/';
            } else {
                $lang['url'] = '/' . $lang_code . '/author/' . $author_slug . '/';
            }
        }
    }
    return $languages;
}