Common IssuesTranslation fails with "There is no custom post with ID ..."
Translation fails with "There is no custom post with ID ..."
If the translation of a post fails, and you see an error message like this in the Logs:
[Query "create-missing-translation-customposts"] Execution with errors: 🔴 There is no custom post with ID '30967'
The issue might be that the DB contains stale/corrupted data from Polylang, including relationships to posts that don't exist anymore (that somehow Polylang did not delete).
A solution is to recreate the post from scratch:
- Create a new post
- Copy/paste the data
- Delete the previous post
As the new post contains no stale metadata (i.e. no relationships to non-existing posts), translating it will work.
Otherwise (only if you know what you're doing: you can break things!), check in the DB where that relationship to that non-existing ID is in Polylang, and remove it.