WordPress (self-hosted) 向け glot
CMS · プラグイン
glot は WordPress (self-hosted) にプラグインとしてインストールします。設定方法は下の手順のとおりです。
プラットフォーム側の手順は、WordPress (self-hosted) の画面のメニュー名に合わせて英語で記載しています。
glot プラグインをインストールする
- 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.
別の方法:ユニバーサルタグ
WordPress (self-hosted) 連携で対応していない部分をブラウザで翻訳するには、ユニバーサルタグを追加します。
- glot でプロジェクトを作成し、言語を追加します。
- glot Edge → サイト用タグを開き、サイトのアドレスを入力します。glot がサイトを翻訳してプレビューを表示します。タグを貼り付けたら、同じ画面でインストールを確認し、タグをオンにします。
- そのタブからタグをコピーします。プロジェクトと公開キー(data-key)はすでに入っています。下のタグはその形式の例です。
<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.
必要なプラン
Available on any self-hosted WordPress install; you need an administrator account that can install plugins.
glot の各プランの内容は料金ページをご覧ください。glot Edge(翻訳済み URL)は Growth プランに含まれ、Pro では限定トライアルを利用できます。
検索エンジン向けの翻訳済み URL
JavaScript を実行せずに検索エンジンがインデックスできる翻訳ページにするには、2 つの DNS レコードで glot Edge をドメインのサブドメイン(es.example.com)に置きます。
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.
glot Edge の仕組みよくある質問
- glot は WordPress (self-hosted) のパートナーですか?
- いいえ。glot は独立しており、WordPress (self-hosted) との提携や WordPress (self-hosted) による推奨はありません。このガイドは WordPress (self-hosted) の標準機能だけを使っています。
- glot は WordPress (self-hosted) のコンテンツを変更しますか?
- 元のコンテンツはそのままです。プラグインはブラウザでページを翻訳し、接続すると、公開前に確認できる言語フィールドに翻訳を書き込みます。
- 翻訳は検索エンジンにインデックスされますか?
- タグだけではほとんどされません。ブラウザで翻訳するため、検索エンジンが主にインデックスするのは元の言語です。言語ごとの URL を持つ翻訳ページには、glot Edge か、言語ごとに 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.
WordPress (self-hosted) の公式ドキュメント
WordPress (self-hosted) のサイトを翻訳する
プロジェクトを作成して言語を選び、上の手順に従ってください。
その他の連携:CMS
WordPress (self-hosted) は各所有者の商標です。glot は WordPress (self-hosted) と提携していません。