- Handle Custom Stripe Webhook Events
- suredonation_export_secret_option_keys Filter Hook
- suredonation_import_batch_complete Action Hook
- suredonation_import_complete Action Hook
- suredonation_import_donation_inserted Action Hook
- suredonation_import_donor_inserted Action Hook
- suredonation_import_session_created Action Hook
- suredonation_import_givewp_batch_complete Action Hook
- suredonation_import_givewp_session_created Action Hook
- suredonation_privacy_data_exported Action Hook
- Validate Field Filter Hook
- Validatable Blocks Filter Hook
- Update donation data, Filter Hook
- OttoKit Integration: suredonation_suretriggers_integration_data_filter Filter Hook
- suredonation_show_setup_gateway_notice Filter Hook
- suredonation_show_review_notice_gateway Filter Hook
- suredonation_show_review_notice_donation Filter Hook
- suredonation_registered_payment_methods Filter Hook
- suredonation_register_additional_blocks Filter Hook
- suredonation_receipt_html Filter Hook
- suredonation_phone_geo_enabled Filter Hook
- suredonation_phone_geo_api_hourly_cap Filter Hook
- suredonation_paypal_webhook_handle_event Filter Hook
- suredonation_paypal_sdk_args Filter Hook
- suredonation_output_campaign_meta_tags Filter Hook
- suredonation_new_donor_user_data Filter Hook
- suredonation_integration_payload Filter Hook
- suredonation_import_phase_mappers Filter Hook
- suredonation_import_givewp_phases Filter Hook
- suredonation_import_givewp_phase_mappers Filter Hook
- suredonation_import_donation_row Filter Hook
- suredonation_import_campaigns_limit Filter Hook
- suredonation_field_block_config Filter Hook
- suredonation_export_one_time_only Filter Hook
- suredonation_export_campaigns_limit Filter Hook
- suredonation_email_smart_tags Filter Hook
- suredonation_email_smart_tag_groups Filter Hook
- suredonation_email_field_char_limits Filter Hook
- suredonation_disable_default_styles Filter Hook
- suredonation_default_validation_messages Filter Hook
- suredonation_default_email_notifications Filter Hook
- suredonation_create_donation_data Filter Hook
- suredonation_config_abilities Filter Hook
- suredonation_available_payment_methods Filter Hook
- suredonation_allowed_form_html Filter Hook
- suredonation_allowed_form_blocks Filter Hook
- Validatable Blocks Filter Hook
- Update donation data, Filter Hook
- OttoKit Integration: suredonation_suretriggers_integration_data_filter Filter Hook
- suredonation_show_setup_gateway_notice Filter Hook
- suredonation_show_review_notice_gateway Filter Hook
- suredonation_show_review_notice_donation Filter Hook
- suredonation_registered_payment_methods Filter Hook
- suredonation_register_additional_blocks Filter Hook
- suredonation_receipt_html Filter Hook
- suredonation_phone_geo_enabled Filter Hook
- suredonation_phone_geo_api_hourly_cap Filter Hook
- suredonation_paypal_webhook_handle_event Filter Hook
- suredonation_paypal_sdk_args Filter Hook
- suredonation_output_campaign_meta_tags Filter Hook
- suredonation_new_donor_user_data Filter Hook
- suredonation_integration_payload Filter Hook
- suredonation_import_phase_mappers Filter Hook
- suredonation_import_givewp_phases Filter Hook
- suredonation_import_givewp_phase_mappers Filter Hook
- suredonation_import_donation_row Filter Hook
- suredonation_import_campaigns_limit Filter Hook
- suredonation_field_block_config Filter Hook
- suredonation_export_secret_option_keys Filter Hook
- suredonation_export_one_time_only Filter Hook
- suredonation_export_campaigns_limit Filter Hook
- suredonation_email_smart_tags Filter Hook
- suredonation_email_smart_tag_groups Filter Hook
- suredonation_email_field_char_limits Filter Hook
- suredonation_disable_default_styles Filter Hook
- suredonation_default_validation_messages Filter Hook
- suredonation_default_email_notifications Filter Hook
- suredonation_create_donation_data Filter Hook
- suredonation_config_abilities Filter Hook
- suredonation_available_payment_methods Filter Hook
- suredonation_allowed_form_html Filter Hook
- suredonation_allowed_form_blocks Filter Hook
- suredonation_import_batch_complete Action Hook
- suredonation_import_complete Action Hook
- suredonation_import_donation_inserted Action Hook
- suredonation_import_donor_inserted Action Hook
- suredonation_import_session_created Action Hook
- suredonation_import_givewp_batch_complete Action Hook
- suredonation_import_givewp_session_created Action Hook
- suredonation_privacy_data_exported Action Hook
- suredonation_enqueue_form_frontend_scripts Action Hook
- suredonation_after_form_duplicated Action Hook
- suredonation_email_sent Action Hook
- suredonation_donor_user_created Action Hook
- suredonation_donation_refunded Action Hook
- suredonation_donation_status_changed Action Hook
- suredonation_donation_completed Action Hook
- suredonation_new_donation Action Hook
- suredonation_donation_created Action Hook
suredonation_export_campaigns_limit Filter Hook
Overview
The suredonation_export_campaigns_limit filter controls the maximum number of campaigns included in a single campaign export from SureDonation → Tools → Import & Export.
This filter is useful for controlling memory usage and execution time when exporting a large number of campaigns.
Each campaign may also load its linked donation forms and metadata, so exporting a large number of campaigns can require significant server resources.
When to Use This Filter
Use this filter when you need to:
- Reduce memory usage during campaign exports.
- Prevent PHP execution timeouts.
- Export campaigns in smaller batches.
- Adjust the export limit based on your hosting environment.
- Handle large campaign libraries more safely.
Filter Signature
apply_filters( 'suredonation_export_campaigns_limit', 10000);Parameters
| Parameter | Type | Description |
| $limit | int | Maximum number of campaigns included in a single export. |
Default Value
10000
Return Value
Return the maximum number of campaigns that should be included in the export.
return 500;
The returned value is used as the campaign export limit.
Basic Usage
add_filter('suredonation_export_campaigns_limit', 'your_custom_function', 10, 1 );
function your_custom_function( $limit ) {
// Modify the campaign export limit.
return $limit;
}Example: Lower the Export Limit
If the website is hosted on shared hosting with limited memory, you can reduce the number of campaigns exported in one request.
add_filter( 'suredonation_export_campaigns_limit', 'mysite_lower_campaign_export_cap', 10, 1);
function mysite_lower_campaign_export_cap( $limit ) {
// Export fewer campaigns per request.
return 500;
}This limits the export to 500 campaigns per request.
Why Adjust the Export Limit?
Campaign exports can require more resources than expected because SureDonation also processes data associated with each campaign, including:
- Linked donation forms
- Form metadata
- Campaign metadata
- Form references within campaign content
Therefore, exporting 1,000 campaigns does not simply mean processing 1,000 database records.
Recommended Configuration
For a website with limited server resources, start with a smaller limit:
add_filter( 'suredonation_export_campaigns_limit', function () {
return 500;
}
);If the export completes successfully, you can gradually increase the limit based on your hosting capacity.
Troubleshooting Export Timeouts
If the campaign export fails, times out, or produces an incomplete JSON file:
- Reduce the campaign export limit.
- Run the export again.
- Increase the limit gradually if the server can handle it.
- Avoid increasing the limit on servers with strict memory or execution-time limits.
For example: return 250;
may be more appropriate for a resource-constrained server than: return 10000;
Important: Synchronous Export
The campaign export runs synchronously during the request that starts the download.
This means the server must complete the export before the request finishes.
A very high limit can increase the risk of:
- PHP memory exhaustion
- Request timeouts
- Incomplete exports
- Truncated JSON files
If the export is timing out, lower the limit rather than simply increasing the server limits.
Related Hooks
- suredonation_import_campaigns_limit: Controls the maximum number of campaigns imported in a single request.
- suredonation_export_secret_option_keys: Prevents sensitive settings from being included in exports.
- suredonation_export_one_time_only: Controls whether recurring donations are included in donation exports.
We don't respond to the article feedback, we use it to improve our support content.