Docs & Support

Learn about all the Formidable features and get support from our amazing customer success team.

frm_export_content

Heads up!
This article contains PHP code and is intended for developers. We offer this code as a courtesy, but don't provide support for code customizations or 3rd party development.

Make changes to the content used in the exported CSV.

Usage

add_filter( 'frm_export_content', 'change_exported_cell' );
function change_exported_cell( $content )

Formidable Forms makes advanced site building simple. Launch forms, directories, dashboards, and custom WordPress apps faster than ever before.

Parameters

  • $content (string): The value to be exported.

Examples

Exporting views includes all of the content. This example removes a "View more" since it isn't needed in the view.

add_filter( 'frm_export_content', 'change_exported_cell' );
function change_exported_cell( $content ) {
  $content = str_replace( 'View more', ' ', $content );
  return $content;
}

Replace ampersand HTML in CSV export

Use the code below to replace the ampersand HTML in exported field.

add_filter( 'frm_export_content', 'replace_ampersand' );
function replace_ampersand( $content ) {
  $content = str_replace( 'amp;', ' ', $content );
  return $content;
}

Add apostrophe for phone numbers

Use this code snippet to add the apostrophe if the value looks like anything but a number with some periods or dashes. If you have removed '+' from the risky characters list, this will add the apostrophe for potentially risky cells but removes the apostrophe before the '+' sign for phone numbers.

add_filter(
	'frm_export_content',
	function( $cell ) {
		if ( '+' === substr( $cell, 0, 1 ) && ! cell_is_phone_number( $cell )  ) {
			return "'" . $cell;
		}
		return $cell;
	}
);

function cell_is_phone_number( $cell ) {
	$substring = substr( $cell, 1 );
	$substring = str_replace( array( '-', '.' ), array( '', '' ), $substring );
	return is_numeric( $substring );
}

frm-export-content Phone Numberfrm-export-content Add apostrophe

Was this article helpful? *

This article may contain affiliate links. Once in a while, we earn commissions from those links. But we only recommend products we like, with or without commissions.

In this article

    We have a small, but amazing team of dedicated people who are committed to helping you achieve your goals and project requirements.


    Copyright © 2025 Strategy11, LLC. Formidable Forms® is a registered trademark Strategy11, LLC.

    Join 400,000+ using Formidable Forms to create form-focused solutions fast. Get Formidable Forms