Add a Twig filter for CraftCMS templates to "prune" out fields of entries.
prune
directory into your craft/plugins
directory.prune
pluginThe primary reason for this is to control the fields being output to json_encode
.
{{ craft.entries.section('news').find() | prune(['title', 'body']) | json_encode() | raw }}
The above template will get all entries from the "news" section, grab just the title and body fields from each, and then output it to JSON.