Hooks & Filter

Simply Static and Simply Static Pro provides a lot of useful filters and actions to modify the behavior of static exports. This docs section is dedicated to developers, so expect a lot of code to read.



You can use this filter to modify the Simply Static settings array. Useful if you want to change certain options temporarily. A use case for that could be changing the export directory based on the language you are currently selected. It’s used to make the multilingual integration in Simply Static Pro:

add_filter( 'ss_get_options', function ( $options ) {
	$options['local_dir'] = 'your/custom/path';

	return $options;
} );


You can use that filter to modify the list of tags and attributes Simply Static uses to extract information from the HTML of your website. This can be used to add support for background images, for example.

add_filter( 'ss_match_tags', function ( $match_tags ) {
	$match_tags['div'] = array( 'href', 'src', 'style' );

	return $match_tags;
} );


This filter can be used to change the URL Simply Static is using to export a static version of your website. This is useful if your admin URL differs from the frontend URL of your website.

add_filter( 'ss_origin_url', function ( $url ) {
	$url = 'https://mywebsite.com';

	return $url;
} );


You can use this filter to increase the number of pages Simply Static is fetching per iteration. This can increase the export speed but can also cause a timeout if you processing large batches on a cheap server.

add_filter( 'simply_static_fetch_urls_batch_size', function ( $batch_size ) {
	$batch_size = 50;

	return $batch_size;
} );


You can use this filter to deactivate the e-mail notification send by the Simply Static webhook after someone submits your form on your static website. This can be useful if you integrate your own process (parsing information, sending it to external services).

add_filter( 'ssp_send_webhook_mail', function ( $send_mail ) {
	$send_mail = false;

	return $send_mail;
} );


You can use this filter to remove the excerpt from the Algolia search integration.

add_filter( 'ssp_algolia_use_excerpt', function ( $use_excerpt ) {
	$use_excerpt = false;

	return $use_excerpt;
} );