How to get content translations programmatically

In order to get current content translations of the current post in MultilingualPress, you can use the Translations class passing the arguments via TranslationSearchArgs. Here is an example:

add_filter('the_content', function($content) {
    $args =
            new \Inpsyde\MultilingualPress\Framework\WordpressContext()

    $translations = \Inpsyde\MultilingualPress\resolve(

    foreach ($translations as $translation) {
        $postId = $translation->remoteContentId();
        $title = $translation->remoteTitle();
        $url = $translation->remoteUrl();

        $language = $translation->language();
        $bcp47tag = $language->bcp47tag();
        $englishName = $language->englishName();
        $isoCode = $language->isoCode();
        $locale = $language->locale();
        $name = $language->name();

    return $content;


Now you can loop through the $translations array where each Translation object contains translation data and language information.

Build the perfect multilingual webshop with WooCommerce and our plugins MultilingualPress and CentralStock!