Home › Forums › General Issues › Does hard coding ACF fields increase speed of wordpress? › Reply To: Does hard coding ACF fields increase speed of wordpress?
No problem 🙂 Yes the JSON feature is incredibly useful especially for me as a developer to keep fields in sync between enviroments.
Unfortunately it will not improve performance in your theme where you fetch all the posts and their meta values. The get_field (and similar functions) are all basically wrappers for WordPress own functions such as get_post_meta etc. (they do some more stuff like changing the return value and setting up repeaters etc as well).
The information always have to come from the database.. BUT! There is still stuff you can do.
You can for example in some cases see improvement in performance if you use the
get_fields function http://www.advancedcustomfields.com/resources/get_fields/.
Or take it a step further and create your own transients in which you store some values so your visitor don’t have to fetch them dynamically on every page load. https://codex.wordpress.org/Transients_API
And of course caching is important but I’ll assume you have that already!
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We’re hard at work on ACF 6.1, and Beta 1 is now available 🚀— Advanced Custom Fields (@wp_acf) March 16, 2023
This release includes custom post type and taxonomy registration, an improved experience when selecting field types, PHP 8.1 and 8.2 compatibility, and more!
Let’s take a look 🧵https://t.co/Y0WcAT11l4
© 2023 Advanced Custom Fields.