Joomla Language Filter - big

Sometimes there are websites where click on the flag of the required translation language unexpectedly moves a visitor, for example, to the main page, or leaves him on the current one. Probably the necessary page is missing, and the web-designer simply did not take care to notify about it. Modern Joomla has extensive capabilities to support multilingualism in such cases, but there is a nuances.

Attribute "hreflang"

Let's say the menu descriptor looks like this:

JustOneLangSupported
You show or hide the Language Switch Module on the respective pages and, by setting up the Language Filter plugin, you will receive an automatic SEO improvement as a gift. Joomla will automatically add relevant information to the page header:

hreflang OK
However, this does not happen in the case of absentee of translation pages as mentioned above, even if you allow adding of "x-default" tag in the  Language Filter plugin, or display the Active Language flag in the Language Switch module settings (Joomla version 3.9.1):

hreflang absent
Probably the developers assumed that there should be translations for all declared languages, or at worst, blank pages with standard apologies. But, if you have many documents, then you will spend a lot of time on the assignment of useless associations, etc. I did not expand the corresponding system plugin in standard way, but simply added two lines to the function 'onAfterDispatch ()' in the file '/plugins/system/languagefilter/languagefilter.php' (see the code starting at line 826):

PatchCode
Now looks better:

hreflang restored

Redirect 301

Try to avoid links from multilingual pages to pages, that do not have a translation. In the following screenshot of the results of the ScreamingFrog program, you can see an example of 301 redirects generated by such a link:

Redirect 301
Joomla! will be updated soon and maybe in version 4.0 this problem will be solved. Search engines do not welcome redirects 301 and you can either delete such links, or have patience and repeat the following steps for each page:

  • Create an Article Category and assign language associations
  • Create an article and assign language associations
  • Create a menu item, connect an article to it
  • Mark the display of the Language Switcher module for this article
  • Allow display of the Main Menu (Top) when displaying this article
  • Create a Menu Module (side) to select from a group of articles in this category
  • Connect the article to the Module and assign language associations
  • Adjust links to this article

Note: do not forget to forcefully scan Categories and Menus after the update (click the button Build). From my own very old negative experience, I assume that this button was added because Joomla! stores important settings in JSON structures of Database fields of the type 'mediumtext'.

The following picture shows the page of the announcement of the missing translation of the material:

Sorry page

Let's check the result of our works:

StillErr

The list of redirects has changed somewhat, but they have not disappeared! Prohibit the removal of the default Language code from the URL:

LanguageFilterPlugin

I hope the above material will be useful to you.