PR-5.3-dev Pending

User tests: Successful: Unsuccessful:

avatar weeblr
weeblr
24 Apr 2025

SEF and multilingual. The hreflang tag pointing to itself is missing.

Pull Request for Issue #44297 .

Summary of Changes

Disable canonical link tag output by SEF system plugin on mulitlingual site.

Problem

When user enters a domain in the SEF system plugin, Joomla tries to output a canonical tag using that domain. In most cases, the domain in question is just the website current domain, not an alternate one, which is what the canonical feature was designed to handle.

A negative consequence is that the hreflang output on multilingual websites is broken. Joomla HTMLDocument can only handle one single tag per URL and the hreflang link created by the language filter plugin is replaced by the canonical one.

Considering the use case for the canonical is both much less common and much less important, but the hreflang being broken is much more serious, this PR disables the canonical link output on multilingual websites until such time HTMLDocument is able to output multiple tags per URL.

I have looked at HTMLDocument code and I don't see how required changes can be made without a B/C break (notably due to the getHeadData() public method).

So I believe just disabling that canonical is a good trade-off to solve a pretty big issue rapidly.

Testing Instructions

Use a multilingual website for this test. Any language, any number of languages. Using the Joomla multilingual sample data is fine for this test.

Actual result BEFORE applying this Pull Request

1 - In the SEF system plugin options, enter the website domain in the Site domain field
2 - On any frontend page, open the page source code (Ctrl/Cmd-U) on most browsers and check that there's a canonical link but there is no hreflang link tag for the current page URL and language.

Expected result AFTER applying this Pull Request

Reload the same page and check that:

  • there's no more canonical link tag
  • there's an hreflang link tag for all languages, including the current page language.

Link to documentations

Please select:

  • Documentation link for docs.joomla.org:

  • No documentation changes for docs.joomla.org needed

  • Pull Request link for manual.joomla.org:

  • No documentation changes for manual.joomla.org needed

/JDayUSA2025 PBF

avatar weeblr weeblr - open - 24 Apr 2025
avatar weeblr weeblr - change - 24 Apr 2025
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 24 Apr 2025
Category Front End Plugins
avatar weeblr weeblr - change - 13 May 2025
Labels Added: PR-5.3-dev
avatar joomla-cms-bot joomla-cms-bot - change - 13 May 2025
Category Front End Plugins Modules Front End Plugins
avatar HLeithner HLeithner - close - 22 May 2025
avatar HLeithner
HLeithner - comment - 22 May 2025

@weeblr thanks for your pr, but it has some unrelated changes and the way how it is fixed is not how the maintainer want it. In the Wednesday meeting we decided to go with martins try to resolve the underlying issue in #45428 which is targeted for joomla 6.0. It might need some work and concept change but is the more proper way.

I'm closing this, but anyway thanks for your time you invested in this issue.
Harald

avatar HLeithner HLeithner - change - 22 May 2025
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2025-05-22 07:12:41
Closed_By HLeithner
avatar weeblr
weeblr - comment - 22 May 2025

@HLeithner I find this very unfortunate. I'm not sure what line of thoughts led to that decision but it appears entirely wrong to me.

This is not about my own PR, martins initial PR was just fine (and yes, I realize now I mixed up 2 PRs in one here, the changes related to the breadcrumb issue are of course out of scope here).

But Joomla multilingual system not being able to output hreflang correctly is an outright major bug and affect the SEO of all Joomla multilingual sites in a major way.

As long as it was un-noticed, fine. But now it was noticed, so that huge bug needs fixing immediately.

You can certainly have a more robust solution in 6.0, but there's no waiting to fix that.

Please reconsider ASAP, so that it can go into next 5.3.x bug fix release as it should. I'd suggest you simply use Martin's initial PR, if this seems more robust, but my one line fix until 6.0 will also do.

Anything but leaving such a gaping issue open.

Add a Comment

Login with GitHub to post a comment