Support

Account

Home Forums ACF PRO High number of queries when updating post Reply To: High number of queries when updating post

  • As far as I know, ACF does pull from wp_cache, but the cache only contains values for custom fields that have already been used one. Each time you use an ACF function to get a field value it will generate several queries.

    If you’re talking about the back end when updating a post, there really is not any way to reduce the number of queries needed to update all of the fields. ACF is a great plugin but it is uses WP function for updating values so with a lot of fields the update process will be slow, and can even time out if you have too many. I’ve found that this is important to keep in mind when designing an admin page and how it will work.

    On the front end you may be able to reduce the number of queries to get the information by forcing WP to get all of the meta values for a post before trying to access any of them. You can do this by calling get_post_meta() without giving a field name get_post_meta($post_id); https://developer.wordpress.org/reference/functions/get_post_meta/