This lightweight SEO plugin for WordPress allows changing the default HTML lang attribute globally, and on individual Posts and Pages. Along with cross-referencing similar Posts/Pages in different Languages using Alternate Hreflang tags.
The Plugin is mostly of use when your WordPress blog contains a mix of languages with individual Posts/Pages, and you do not want to install a huge translation plugin (because your posts are not actually translations, but just each individually published in a different content language). Accordingly you may also not want to change any of the URLs of your existing articles.
I developed this because my Blog is mostly written in English, but contains some articels written in German - of which some have gotten a content recycle across the two languages. And I wanted to improve their respective search engine optimization. In addition, with this plugin, I was able to change the default "English (United States)" (en-US
) language code to just neutral "English" (en
).
language-locale-overwrite
-folder into your WordPress Plugin directory:[wordpress]/wp-content/plugins/
<html lang="ā¦">
og:locale
you can set a preferred 2-char country code using Ā«Custom Country codeĀ»Pre-requisite: you must have Post/Pages already tagged with a "non-default" language locale!
Valid language locales either consist of 2-characters ISO-code for languages, or a combination thereof with a 2-characters ISO country code. Here are some examples:
de
ā Germande-DE
ā Germany (German)de-CH
ā Switzerland (German)en
ā Englishen-GB
ā United Kingdom (English)fr
ā Frenchzh-CN
ā Chinese (Simplified)