Problem:
You are experiencing 504 Gateway Timeouts and significant performance degradation due to increased internal calls to
get_field_groups_by_object_type
after updating WPML and ACF Pro plugins. This issue is linked to how ACFML handles field group translations, especially during REST API requests.
Solution:
We recommend using the
acfml_should_translate_acf_entity
filter introduced in ACFML version 2.1.4 to selectively disable translation logic during REST API requests. Here is how you can implement it:
add_action( 'rest_api_init', function() {
if ( wp_is_serving_rest_request() ) {
add_filter( 'acfml_should_translate_acf_entity', '__return_false' );
}
}, 5 );
It is advisable to add this snippet in a Must-Use plugin for optimal performance.
For more details, refer to the official documentation: ACFML filter documentation, and the release notes: ACFML 2.1.4 release.
If this solution does not resolve your issue or seems outdated, please check related known issues at https://wpml.org/known-issues/, verify the version of the permanent fix, and confirm that you have installed the latest versions of themes and plugins. If the problem persists, we highly recommend opening a new support ticket for further assistance.