Skip Navigation

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

Problem:
If you're experiencing issues with hreflang tags not appearing on author pages of your site, it might be due to the absence of standard posts assigned to the author. Hreflang tags are essential for multilingual SEO, indicating to search engines the language and regional URL variations.

Solution:
We recommend checking if the author has standard posts assigned to them. For hreflang tags to appear correctly on author pages, there must be at least one standard post assigned to the author. If there are only custom posts or no posts, hreflang tags will default to pointing towards the homepage. Here is an example of how hreflang tags should appear when set up correctly:

<link rel="alternate" hreflang="en" href="https://example.com/author/name/" /><br /><link rel="alternate" hreflang="fr" href="https://example.com/fr/author/name/" /><br /><link rel="alternate" hreflang="x-default" href="https://example.com/author/name/" />

If this solution does not apply because your setup involves custom posts or other complexities not covered by standard WordPress functionality, we suggest seeking a custom solution or consulting with your theme or page builder support.

Please note that this solution might be outdated or not applicable to your specific 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 the issue persists, please open a new support ticket.

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

Last updated by danielH-157 1 day, 20 hours ago.

Assisted by: Waqas Bin Hasan.

Author Posts
January 27, 2025 at 10:29 am #16636994

danielH-157

Background of the issue:
I am trying to resolve an issue with hreflang tags not appearing on author pages of my site, hidden link.

Symptoms:
The hreflang tags are not showing on any author pages, and the URLs are different....

Questions:

January 27, 2025 at 12:30 pm #16637694

Waqas Bin Hasan
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi,

Reference to our recent chat, I tried to reproduce the issue in a fresh sandbox site (hidden link) and this seems to work fine.

Can you please login to hidden link (one-click login) and try to reproduce the issue?

Please note down the steps you performed, so I can then try to reproduce accordingly.

Regards.

January 27, 2025 at 12:38 pm #16637714

danielH-157

i dint get this?
how can i show the issue in this sand box website instead ill give you login details for my site and you can check it if you want?
we can use staging site to check

January 27, 2025 at 1:26 pm #16638022

Waqas Bin Hasan
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Sure, please provide temporary access (WP-Admin and FTP), preferably to a test site where the problem has been replicated.

Your next answer will be private, to share this information safely.

Also provide detailed steps to reproduce the issue and links to pages in the admin and on the frontend.

IMPORTANT: Please take a complete backup of the site to avoid data loss. I may need to activate/deactivate plugins also.

See https://wpml.org/purchase/support-policy/privacy-and-security-when-providing-debug-information-for-support/ for details on privacy and security.

P.S.: If you don't see the section for providing access information, do not write in the message box or the information may appear as public.

P.S.: I'll be off tomorrow for a local holiday and 'll be able to attend on Wednesday.

January 29, 2025 at 7:52 am #16644608

Waqas Bin Hasan
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thank you for the access and the details.

I am working on this and 'll get back to you as soon as I find something or have a solution.

January 29, 2025 at 11:08 am #16645732

danielH-157

sure

January 30, 2025 at 5:21 am #16649158

Waqas Bin Hasan
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thank you for your patience and cooperation.

I checked and it is working as expected, please see the page source of the followings:

- Default English: hidden link
- French Translation: hidden link

And hreflangs are now appearing as below:

<link rel="alternate" hreflang="en" href="<em><u>hidden link</u></em>" />
<link rel="alternate" hreflang="fr" href="<em><u>hidden link</u></em>" />
<link rel="alternate" hreflang="x-default" href="<em><u>hidden link</u></em>" />

I didn't do anything special because this works out of the box. However, you have to add/assign a post (standard post type "Post", not the CPT or Page) to the author, for its Author Page and Profile to work.

For example, see the attached screenshot, and notice that the said author (Robert J. Williams), has only 1 Post, while on the above URL, you are showing several custom posts (coming from a CPT). This means that WordPress does not count Pages and Custom Posts under user profile. It only considers standard Posts and its translations (which are also posts but in another language). So if you go to Users now, you 'll see a count of 2 for this author, which includes a post I created in "Posts" (Test WPML) and its French translation.

So, in short, there "must" be a post assigned to an author, for the hreflangs to work as expected (above). Otherwise, hreflangs 'll still be available but pointing to the home page (like below), as it can be seen with this author hidden link, which has no post assigned yet:

<link rel="alternate" hreflang="en" href="<em><u>hidden link</u></em>" />
<link rel="alternate" hreflang="x-default" href="<em><u>hidden link</u></em>" />

Please note that the custom posts you're showing on the author pages, are not WordPress standard functionality, but a theme or page builder's added feature. So I'll recommend checking for a custom solution to add expected hreflangs to author pages, in such a scenario, because this isn't a WPML issue.

Screenshot 2025-01-30 100659.jpg
January 30, 2025 at 10:05 am #16650313

danielH-157

ya i found the solution and i fixed it thanks for pointing out the issue.