WordPress - How does Weglot manage your website's SEO?

In this article, you'll learn how Weglot manages your website's SEO to ensure that Google indexes all translated versions of your website.



Multilingual SEO best practices guidelines (as per Google here) require including the following key aspects:

1. A unique URL for each version of your web page

Weglot automatically creates "/[2-letter code]" subdirectory for each translated version of your pages. 

E.g. German version of the webpage below: 

E.g. Spanish version of the webpage below: 



2. Hreflang tags for Google indexing bots

Weglot automatically adds hreflang tags in your source code. These tags let Google know you have different versions of the same page and favor indexing of these pages. You can find these hreflang tags in the tag "head" of your website source code.

Note that you don't need to edit your sitemap with this method.


The "x-default" tag

The "x-default" hreflang is not necessary for most websites and is not added to your website by Weglot.

This tag is specifically used to indicate which version of your site should be served to users whose language isn't explicitly covered by other hreflang tags. This is typically only needed for a homepage that serves as a language selection page and doesn't match any specific language itself.

If you wish to add it to your website, you can do so using the PHP filter below as a snippet (using the Code Snippets plugin, for example) or in your functions.php file:

add_filter( 'weglot_href_lang', 'custom_weglot_href_lang' );
function custom_weglot_href_lang( $render ) {
	$relativeURL = $_SERVER['REQUEST_URI'];
	$render = "<link rel=\"alternate\" href=\"https://yourwebsiteURLhere" . $relativeURL . "\" hreflang=\"x-default\"/>" . $render;
	return $render;
}

You'll need to edit it with the URL of your website ("https://yourwebsiteURLhere ").


3. Having content translated into the source code

Weglot translated content on the server side, meaning that your content is translated into your source code and not just dynamically (like with a JavaScript solution: Google does not see JavaScript).

4. Detect and translate websites' SEO tags

Weglot automatically does that on the server side again. 

E.g. Meta-description for the English version of the website:

E.g. Meta-description for the Kazakh version of the website:  


Weglot follows all of Google's best practices. Therefore, with Weglot, all the translated pages will also be indexed and displayed to foreign visitors without any additional work from the website owner.

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us