[Resolved] issue with hreflang not showing in author pages
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:
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.
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
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:
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.