glot for WordPress (self-hosted)
CMS · Plugin
glot installs in WordPress (self-hosted) as a plugin. The steps below set it up.
Install the glot plugin
- Download glot.zip (built from integrations/wordpress-plugin in the glot repository; it isn't on WordPress.org yet). It needs WordPress 6.1+ and PHP 7.4+.
- In WordPress, go to Plugins → Add New → Upload Plugin, upload glot.zip and activate it.
- Open Settings → glot and enter your project slug, your public key (pk_…, never a secret glot_… key), the source language and your languages, then save. The plugin adds glot.js to every front-end page.
- Optional: place the language switcher with the [glot_switcher] shortcode, the glot language switcher widget or block, or the Elementor widget; otherwise it sits in the corner you picked.
- Optional: for translated URLs, set up glot Edge (subdomain or subdirectory) and choose it as the SEO mode, so the plugin adds hreflang links to the Edge pages.
- Optional: click Connect to glot with a glot API token to link the WordPress connector, so translations are also written into Polylang Pro or WPML posts.
Alternative: the universal tag
To translate in the browser what the WordPress (self-hosted) integration doesn't cover, add the universal tag instead.
- In glot, create a project and add your languages.
- Open glot Edge → Website tag and enter your site's address: glot translates it and shows you a preview. Once the tag is pasted, check the installation there and turn the tag on.
- Copy your tag from that tab: it already carries your project and its public key (data-key). The tag below shows its shape.
<script src="https://app.glotlang.com/widget/glot.js" data-project="your-project" data-key="pk_…" async></script>- In WP Admin, go to Plugins → Add New and install and activate "WPCode – Insert Headers and Footers + Custom Code Snippets".
- Go to Code Snippets → Header & Footer.
- Paste the glot tag into the Header box.
- Click Save Changes.
- Clear any page cache (caching plugin or host) and check a few pages.
Plan requirements
Available on any self-hosted WordPress install; you need an administrator account that can install plugins.
On the glot side, see Pricing for what each plan includes. glot Edge (translated URLs) is part of the Growth plan, with a limited trial on Pro.
Translated URLs for search engines
For translated pages that search engines index without running JavaScript, put glot Edge on a subdomain of your domain (es.example.com) with two DNS records:
es.example.com. CNAME edge.glotlang.com.
_glot.es.example.com. TXT "<token shown in the dashboard>"Add the CNAME and TXT records wherever your domain's DNS is managed (registrar, host or Cloudflare). Self-hosted WordPress always runs on a domain you control.
How glot Edge worksQuestions
- Is glot a WordPress (self-hosted) partner?
- No. glot is independent, and not affiliated with or endorsed by WordPress (self-hosted). This guide only uses WordPress (self-hosted)'s standard features.
- Does glot change my WordPress (self-hosted) content?
- Your source content stays as it is. The plugin translates pages in the browser and, when you connect it, writes translations into language fields you review before publishing.
- Will search engines index my translations?
- Not from the tag alone: it translates in the browser, so search engines mostly index your source language. Translated pages with their own URLs need glot Edge or a platform that publishes each language on its own URL.
- Can I edit header.php instead of using a plugin?
- It works, but theme updates overwrite edits to theme files unless you use a child theme. A header/footer plugin survives theme changes.
- My cache plugin serves old pages without the tag.
- Purge the cache after saving the header code.
Official WordPress (self-hosted) documentation
Translate your WordPress (self-hosted) site
Create a project, choose your languages, and follow the steps above.
More integrations: CMS
WordPress (self-hosted) is a trademark of its owner. glot is not affiliated with WordPress (self-hosted).