Bulk importing the signatures
Petitioner supports bulk importing starting from version 0.8.3. Currently, it requires a bit of code to set up. Here is how it works:
Step 1. Prepare the CSV template
First, you need to prepare a CSV file in the correct format. The easiest way to do this is to go to your petition and export the existing entries. Feel free to use filters to export fewer entries (for example, you can filter by a specific email to get just 1 entry to use as a template). To prevent import issues, avoid renaming the column headers or changing boolean formats (like 1 and 0).
Step 2. Add your data & upload
Next, replace the sample row with the new submissions you want to import. Be sure to map out your new data exactly like the original export. Once you are ready, upload your finished CSV file directly to the WordPress media library.
Step 3. The coding part
Now we need to add a small snippet to execute the import. Place the code below into your theme’s functions.php file. Note: you will need to modify the values for $form_id and $csv_url. For non-technical users, feel free to ask an AI assistant like ChatGPT or Claude to help you safely add this!
What does this code do? Petitioner comes with a powerful internal utility class designed for developers called AV_Petitioner_CSV_Importer. This snippet safely connects to that utility and sets up a simple manual trigger. By requiring a specific URL parameter (?av_petitioner_run_import=1) and checking that you are an administrator, it ensures the bulk import only runs exactly when you tell it to.
add_action('admin_init', function() {
$form_id = 1; // <- You need to put your form id here
$csv_url = '/wp-content/uploads/2026-06-15/01/to-import.csv'; // <- Your local CSV url
$field_overrides = []; // <- Optional array to match CSV columns to Petitioner fields
$approve_submission = true; // <- Whether to approve the submission right away
// Only run if you explicitly visit: /wp-admin/?av_petitioner_run_import=1
if (!isset($_GET['av_petitioner_run_import']) || !current_user_can('manage_options')) {
return;
}
$importer = new AV_Petitioner_CSV_Importer([
'form_id' => $form_id,
'csv_url' => $csv_url,
'action' => 'import', // change to `remove` if you are cleaning up
'field_overrides' => $field_overrides,
'approve_submission' => $approve_submission,
]);
$result = $importer->run();
// Dump the result and kill the page so you can see it clearly
wp_die('<pre>' . print_r($result, true) . '</pre>');
});
Once you have added and saved the snippet, navigate to https://yoursite.com/wp-admin/?av_petitioner_run_import=1 in your browser to trigger the import.
That’s it!
(Optional) Removing entries
If you made a mistake or just need to do some cleanup, you can easily remove entries by changing the action value to remove. The importer will match records by their email address and delete them from the database.
(Optional) Handling mismatched column names
If your CSV column headers don’t exactly match your form field names, you can use the $field_overrides array to map them together. For example, if your CSV has a column named “Tel” but Petitioner expects “phone”, you can change the array to: $field_overrides = ['Tel' => 'phone'];.
(Optional) Importing as pending
By default, all imported submissions are instantly approved. If you would prefer to review them manually in the WordPress dashboard before they count towards your petition goal, simply change the $approve_submission variable from true to false.
(Optional) Performance & limits
The importer uses highly efficient file streams, so it takes up almost zero server memory. However, because the entire import runs in a single browser request, your server might eventually hit a “timeout” error if the import takes too long to run. As a general rule of thumb, a standard server can safely import around 10,000 to 50,000 rows at a time. If you have a massive dataset (like 100,000+ submissions), I recommend splitting your CSV into a few smaller files and importing them one by one to avoid server timeouts.