Language Locale Overwrite WP Registry grade A. No security issues foundWP RegistryNo security issues foundOpen the reportA
This lightweight SEO plugin for WordPress allows overwriting the HTML lang attribute, including on individual Posts and Pages. And adds easy-to-use Alternate Hreflang tags.
Install
Upload it under Plugins → Add New Plugin → Upload Plugin, then activate.
Install straight from GitHub with WP-CLI:
wp plugin install https://github.com/swiss-mac-user/language-locale-overwrite/releases/download/2.4.0/language-locale-overwrite-plugin.zipLanguage Locale Overwrite for WordPress
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.
💡 What does this do?
- Allows changing the default HTML lang attribute for your Blog,
- overwriting the HTML lang attribute on individual Posts and Pages (in addition to 1.),
- and cross-referencing Posts/Pages in different languages using Alternate Hreflang tags.
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).
🎓 How to use
⚙️ Install and enable the Plugin
- Download the Plugin
- Place the unzipped
language-locale-overwrite-folder into your WordPress Plugin directory:[wordpress]/wp-content/plugins/ - Go to your WordPress Admin Dashboard » Plugins, and activate «Language Locale Overwrite»
📝 Settings
Global change of <html lang="…">
- Go to your WordPress "Settings » General" at /wp-admin/options-general.php#llo_global
- Set your desired ISO-Language/-Country locale using the setting «Change HTML lang attribute»
- (Optional) For OpenGraph
og:localeyou can set a preferred 2-char country code using «Custom Country code»
Individual HTML lang change for Posts/Pages
- Open any Post or Page, for which you want to modify its language locale
- There's a new section «Language Locale» where a valid ISO-Language/-Country code can be specified
Link Posts/Pages with same content in different languages
Pre-requisite: you must have Post/Pages already tagged with a "non-default" language locale!
- Edit the Post or Page, for which you want to reference a translated Post/Page
- In the «Language Locale» section, use the «Link alternate lang…»-dropdowns to make cross-links
ℹ️ List of valid language locales
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)- …and so on
Releases
6 releases. Each count is every asset in that release; expand a row for the breakdown.
Active-site estimate ≈10 comes from the median of recent superseded releases. Method.