WP Manifestindependent plugin directory
manifest / i18n / polylang-rest

Polylang REST

A Wordpress Plugin to Exposes a post's Polylang language and translation map over the WP REST API

★ 0stars

Install

Download source zip No release zip yet

This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.

Install straight from GitHub with WP-CLI:

wp plugin install https://github.com/reinmengelberg/polylang-rest/archive/refs/heads/main.zip
No built-in updater. New versions won't appear under Dashboard → Updates. Install new releases yourself, or let Git Updater track the repository.

Exposes a post's Polylang language and translation map over the WP REST API, and makes /wp/v2/posts?lang=<code> filter by it.

Free Polylang doesn't do this on its own (it's a Polylang Pro feature).

  • Author: Reinhard Mengelberg
  • Version: 1.0.0

    Install

Pick one of these two paths.

A) As a must-use plugin

No WP admin UI, can't be disabled by accident.

  1. Copy this file to your WP install at:
    wp-content/mu-plugins/polylang-rest.php

    Create the mu-plugins directory if it doesn't exist.

  2. Done. mu-plugins auto-load — no activation step, and they don't appear under WP admin → Plugins, so they can't be deactivated from the GUI. Requires SFTP / host file-manager access.

    B) As a regular plugin

Installs via WP admin GUI, deactivatable.

  1. On your computer, put this file inside a folder of the same name:
    polylang-rest/polylang-rest.php
  2. Zip the folder → polylang-rest.zip
  3. WP admin → Plugins → Add New → Upload Plugin → pick the zip → Install Now → Activate. Trade-off vs (A): anyone with plugin admin can deactivate this from the GUI, which silently breaks the Nuxt sync's language detection.

Verify

After either path, confirm it's working by hitting:

https://applyfin.com/blog/wp-json/wp/v2/posts?per_page=1

The response post should now include a lang field (e.g. "nl") and a translations object (e.g. {"en": 101}). Empty values are normal for posts not yet assigned a Polylang language.

Notes

  • No-ops gracefully when Polylang is inactive (returns null for lang and an empty array for translations), so this file is safe to leave in place even if Polylang is temporarily disabled.
  • We only register on the post type because that's all the Nuxt sync pulls. If you later sync pages or a custom post type, add it here.