---
title: "How to show checkbox fields as comma-separated instead of a bullet list"
date: 2026-04-23
author: "GravityKit"
link: "https://www.gravitykit.com/docs/gravityview/advanced/checkbox-fields-csv/"
---

By default, checkbox fields are displayed as a bulleted list. If you want to display them as a list of comma-separated values (CSV), you can do that with GravityView and a little code.

### Before and After

![Screenshot of a bulleted list with 'first choice' and 'third choice' as bullet items.](https://www.gravitykit.com/wp-content/uploads/2026/04/dbj5Fj.png)
*This is the default look for checkbox fields:*![Screenshot of a bulleted list with 'first choice, third choice' as a single text item.](https://www.gravitykit.com/wp-content/uploads/2026/04/zRANw0.png)
*And this is how the field values look once converted to CSV*

### The required code

```

/**
 * Convert checkbox  to CSV values
 *
 * @param string $output The current output.
 * @param GVTemplate_Context The template context this is being called from.
 */
add_filter( 'gravityview/template/field/checkbox/output', function( $output, $context ) {

	$value = $context->value;

	// If a checkbox value is '' (empty string), this removes it. If you want empty strings, remove the line below.
	$value = array_filter( $value, 'gravityview_is_not_empty_string' );

	return implode( ', ', $value );

}, 10, 2 );
```

```

/**
 * Convert checkbox  to CSV values
 *
 * @param string $output The current output.
 * @param GVTemplate_Context The template context this is being called from.
 */
add_filter( 'gravityview/template/field/checkbox/output', function( $output, $context ) {

	$value = $context->value;

	// If a checkbox value is '' (empty string), this removes it. If you want empty strings, remove the line below.
	$value = array_filter( $value, 'gravityview_is_not_empty_string' );

	return implode( ', ', $value );

}, 10, 2 );
```

Read here how to add these code samples to your website: [Where to put code samples.](https://www.gravitykit.com/docs/gravityview/customizing-your-views/where-to-put-code-samples/)