> For the complete documentation index, see [llms.txt](https://andrearufo.gitbook.io/notes/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://andrearufo.gitbook.io/notes/wordpress/normalizzare-i-custom-fields-di-wordpress.md).

# Normalizzare i custom fields di Wordpress

Quando le informazioni di un post sono molte ed è necessario fare operazioni su molti post contemporaneamente, l'uso della classica `WP_Query` può essere ostico.&#x20;

Usando questo pezzo di codice è possibile interpellare direttamente il database ottenendo una tabella normalizzata di tutti i post desiderati e relativi *custom fileds* così da avere un accesso più semplice e veloce alla collection.

Trovate il Gist col codice su <https://gist.github.com/andrearufo/e036bb8afbede846d8cc5cf5c903a439>
