Common Issues
Common IssuesPosts are not translated

Posts are not translated

If your custom posts are not translated, browse the logs to find an error or warning entry that explains the issue.

To solve the problem, you may need to configure the Settings according to your needs, or posibly recreate the post if it contains stale/corrupted data.

The most common causes, and their solutions, are the following:

No translation entries exist

If you see a warning like this:

Warning [Query "translate-customposts"] Execution successful, but with warnings: 🟡 No custom post(s) was translated, because no translation entries exist. In the plugin Settings, enable the 'Automatic creation of translation entries' option for CPT 'post'; or otherwise, create those translation entries using Polylang (clicking on the '+' link), then trigger the translation.

...that means that the translation entries for your custom posts were not created (before triggering the translation).

In the plugin Settings under General Configuration, check if the Automatic creation of translation entries option is enabled for that CPT:

Setting the 'Automatic creation of translation entries' option
Setting the 'Automatic creation of translation entries' option

If it is not, and that CPT uses wp_insert_post to create entries, then enable that option.

Otherwise, you must first create those translation entries using Polylang (clicking on the + link), then trigger the translation.

Translation entries do not have the expected status

If you see a warning like this:

Warning [Query "translate-customposts"] Execution successful, but with warnings: 🟡 No custom post(s) was translated, because the translation entries (CPT: 'post', IDs: [48634]) do not have the expected status: 'draft'. If this is unintended, either update the  and/or 'Status to synchronize' options in the plugin Settings, or change the status of the translation entries accordingly.

...that means that the translation entries have a different status than the one configured in the plugin Settings.

For instance, if the Status to update option is set to draft, and the translation entries have a status of publish, then the translation will not be created.

In the plugin Settings under General Configuration, check if the Status to update option is set to the expected status:

Setting the 'Status to update' option
Setting the 'Status to update' option

Otherwise, change the status of the translation entries accordingly

Post contains stale/corrupted data

If you see a warning like this:

Warning [Query "translate-customposts"] Execution successful, but with warnings: 🟡 There are no custom posts to translate

...and the log entry shows that, even though the post has a translation post, it doesn't pick it up, then the post may contain stale/corrupt data that needs to be removed.

For instance, check the "Additional context" in this log entry:

{
  "queryExecutionResponse": {
    "data": {
      "originCustomPosts": [
        {
          "__typename": "GenericCustomPost",
          "id": 16597,
          "polylangLanguageLocale": {
            "code": "en"
          },
          "polylangLanguage": "en",
          "originCustomPostHasDefaultLanguage": true,
          "isTranslateFromLanguageProvided": true,
          "originCustomPostHasSpecificLanguage": true,
          "canTranslateOriginPostFromSpecificLanguage": true,
          "canTranslateOriginPost": true,
          "customPostIDTranslationCustomPostIDLanguageIDs": {
            "es": 16613
          },
          "hasTranslationCustomPosts": true
        }
      ],
      "customPostIDTranslationCustomPostIds": {
        "16597": [
          16613
        ]
      },
      "translationCustomPostIdsList": [
        [
          16613
        ]
      ],
      "translationCustomPostIds": [
        16613
      ],
      "translationCustomPostIdToCustomPostIDs": {
        "16613": 16597
      },
      "emptyTranslationCustomPostVars": [],
      "hasTranslationCustomPosts": false
    }
  }
}

In the example above, origin post in English with ID 16597 ("id": 16597, "polylangLanguageLocale": { "code": "en" }) has a translation post for Spanish with ID 16613 ("customPostIDTranslationCustomPostIDLanguageIDs": { "es": 16613 }), yet it doesn't pick it up ("hasTranslationCustomPosts": false).

In this case, that translation post with ID 16613 does not exist anymore, yet the Polylang relationship in post with ID 16597 to that post not been removed.

Due to this stale/corrupt data, the plugin fails to translate the post.

To solve the problem, you need to recreate the origin post, and translate that one. Then, delete the corrupted translation post.