Skip to content

Landing Pages in Target Group Language

By Jasper Frumau SEO

Sometimes you need a landing page or multiple targeting customers in another language than the main website is in. Your website could be in German and your new target groups could be Dutch, English , French and so on. You just need a couple of landing pages in those languages. But SEO wise you do not want to confuse the bots and browsers . You still are a site in the original language. You just have a few landing pages on other languages. Nothing more, nothing less.

WPML, Polylang & Others

You check out several plugins to help you out with the adding of the additional header tags with hreflang and you wind up looking at WPML , Polylang and such. But you do not want to add another plugin for just a few landing pages. You are not going to work on your whole site in multiple languages just yet. You Just want to have a few pages up and running to attract clients from a few other parts of the world.

MU Plugin

Well, in WordPress you can do just that as well. You just need a file with some basic instructions for the landing page or pages in question and add in as must use plugin.

Must-use plugins (a.k.a. mu-plugins) are plugins installed in a special directory inside the content folder and which are automatically enabled on all sites in the installation. Must-use plugins do not show in the default list of plugins on the Plugins page of wp-admin (although they do appear in a special Must-Use section) and cannot be disabled except by removing the plugin file from the must-use directory, which is found in wp-content/mu-plugins by default.

see https://developer.wordpress.org/advanced-administration/plugins/mu-plugins/

In our case it is added to site/web/app/mu-plugins/seo-hreflang.php

SEO Hreflang Tags Plugin

The key is that you need to add the proper tags to the header of course and that you add the proper tags. You need to use <link rel"alternate hreflang="" ahref=""> so the hreflang properly.

The hreflang property of the HTMLLinkElement interface is used to indicate the language and the geographical targeting of a page. This hint can be used by browsers to select the more appropriate page or to improve SEO.

And you need to make it clear you main site is still in the core language. That just the landing page is in another language. That is because hreflang requires reciprocal links. Both pages in the group must declare the complete set of hreflang annotations.

If page A links to page B in hreflang annotations, page B must link to page A in return. If this is not the case for all pages that use hreflang annotations, those annotations may be ignored or misinterpreted correctly. This issue can also be triggered by misused “x-default” hreflang. Whenever the optional “x-default” hreflang value is used, all pages of the hreflang group must reference the same “default”page.

So do do all this you first need to use the WordPress add_action('wp_head') with an anonymous function . In that function you then add the variable with tag to add. You can then of course concatenate more to that variable using .= in PHP. With all added to variable you use the WordPress conditional tags to check for front page or the landing page or pages in question and echo the code.

Example

Here is the full example. Do update the languages, destination urls and add more when need be but that will work just fine.

<?php

/**
 * Plugin Name: SEO Hreflang Tags
 * Description: Adds hreflang alternate link tags for multilingual landing pages.
 * Author: Imagewize
 */

add_action('wp_head', function () {
    $full_set  = '<link rel="alternate" hreflang="en" href="https://imagewize.com/" />'."\n";
    $full_set .= '<link rel="alternate" hreflang="nl-NL" href="https://imagewize.com/nl-wordpress-snelheid-optimalisatie/" />'."\n";
    $full_set .= '<link rel="alternate" hreflang="x-default" href="https://imagewize.com/" />'."\n";

    if (is_front_page() || is_page('nl-wordpress-snelheid-optimalisatie')) {
        echo $full_set;
    }
});

Now this is just a technical part to it all. You still need to write your post with the slug you used in the code above. But that can all be done in your favorite WordPress editor. Write, publish , promote . Tweaks, publish , promote repeat.

Need help setting up landing pages to improve your local SEO? Need a site overhaul? You now where to find me.

Leave a Reply