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.
Table of Contents
Filters
ss_get_options
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 exportThe process of saving the files and data from your WordPress site to create a static site. directoryA folder in a computer’s file system used for storing files and other directories. based on the language you are currently selected. It’s used to make the multilingual integrationThe act of combining different systems, software, or functionalities to work together as a unified whole. in Simply Static Pro:
add_filter( 'ss_get_options', function ( $options ) {
$options['local_dir'] = 'your/custom/path';
return $options;
} );
ss_match_tags
You can use that filter to modify the list of tags and attributes Simply Static uses to extract information from the HTMLHyperText Markup Language. It’s the standard language for creating web pages. 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;
} );
ss_origin_url
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;
} );
simply_static_fetch_urls_batch_size
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;
} );
ssp_send_webhook_mail
You can use this filter to deactivate the e-mail notification send by the Simply Static webhookA method of altering the behavior of a web page with custom callbacks. These are triggered by specific events, like push… 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;
} );
ssp_algolia_use_excerpt
You can use this filter to remove the excerpt from the AlgoliaA record of all the actions and changes made within the Simply Static plugin. It helps you track what has been done. search integration.
add_filter( 'ssp_algolia_use_excerpt', function ( $use_excerpt ) {
$use_excerpt = false;
return $use_excerpt;
} );