- 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_import_campaigns_limit Filter Hook
Overview
The suredonation_import_campaigns_limit filter controls the maximum number of campaigns that SureDonation imports in a single request when restoring a campaigns JSON file.
You can use this filter to lower or increase the import limit based on your server’s available resources and PHP execution limits.
The campaign import process runs synchronously and does not provide a rollback. Setting an appropriate limit can help reduce the risk of a timeout during large imports.
When to Use This Filter
Use this filter when you need to:
- Lower the number of campaigns imported per request.
- Adjust the import limit for shared or resource-constrained hosting.
- Reduce the risk of PHP execution timeouts.
- Control the size of individual campaign import operations.
Filter Signature
apply_filters( 'suredonation_import_campaigns_limit', 1000);Parameters
| Parameter | Type | Description |
| $limit | int | Maximum number of campaigns that can be imported in a single request. |
Default Value
The default limit is: 1000
Campaigns beyond this limit are removed from the import payload before the import begins.
Return Value
Return the campaign import limit as an integer.
return $limit;
For example: return 200;
This limits each import request to 200 campaigns.
Basic Usage
add_filter( 'suredonation_import_campaigns_limit', 'your_custom_function', 10,  1);
function your_custom_function( $limit ) {
    // Modify the campaign import limit.
    return $limit;
}Example: Lower the Import Limit
If your website is hosted on a resource-constrained server with a short PHP execution time, you can lower the limit.
add_filter( 'suredonation_import_campaigns_limit',  'mysite_lower_campaign_import_cap', 10,  1);
function mysite_lower_campaign_import_cap( $limit ) {
    // Shared hosting with a 30-second execution limit.
    return 200;
}With this configuration, a maximum of 200 campaigns will be processed in each import request.
Example: Set a Higher Import Limit
If your server has sufficient resources and you need to process more campaigns per request, you can increase the limit.
add_filter( 'suredonation_import_campaigns_limit', function ( $limit ) {
        return 1500;
    }
);How the Campaign Import Works
The filter is applied during the campaigns JSON import process:
- SureDonation receives the campaigns JSON file.
- The campaign import limit is determined.
- The suredonation_import_campaigns_limit filter is applied.
- Campaigns beyond the returned limit are removed from the payload.
- The remaining campaigns are imported.
- Campaigns and their linked forms are created as published.
- Form IDs are remapped from the original site to the newly created form IDs.
- Campaign block content and default-form references are updated.
- Relevant SureDonation metadata is restored.
Important: No Rollback
The campaign import process does not provide a rollback mechanism.
If an import is interrupted by a timeout or another server error, campaigns that were already created remain on the site.
For this reason, lowering the import limit is recommended on constrained hosting environments.
Importing More Than the Limit
Campaigns beyond the configured limit are not queued for another request.
They are removed from the current import payload.
For example, if the limit is: return 200;
and the JSON file contains 500 campaigns, only the first 200 campaigns are processed.
If you need to import all 500 campaigns, split the JSON file into smaller files and import them separately.
Campaign and Form Data
During the import:
- Campaigns are created as published.
- Linked forms are also created as published.
- The embedded formId values are rewritten from the old IDs to the newly created IDs.
- Form IDs are updated in both form content and campaign block content.
- The campaign’s default-form reference is remapped.
- Only _suredonation_* metadata is restored.
Recommended Configuration
For resource-constrained hosting, start with a lower limit:
add_filter( 'suredonation_import_campaigns_limit', function () {
        return 200;
    }
);Test the import and increase the value gradually if the server can handle the workload reliably.
Related Hooks
- Suredonation_export_campaigns_limit: Controls the maximum number of campaigns included during campaign export.
- Suredonation_import_phase_mappers: Filters the mapper classes used for CSV import phases.
- Suredonation_export_secret_option_keys: Controls option keys that should be excluded from exports.
We don't respond to the article feedback, we use it to improve our support content.