Speed Optimizer 7.8.6 has 4 actions and 36 filters, read directly from its source code on Nov 17, 2026. The list updates automatically when a new version is released.
How to use these hooks
Actions let you run your own code at a specific moment. Filters let you change a value before the plugin uses it. Put your code in a child theme's functions.php or a code-snippets plugin, never in the plugin's own files, because updates overwrite them.
// Run your own code when Speed Optimizer fires an action
add_action( 'siteground_optimizer_flush_cache', function( $url ) {
// Your code runs here.
}, 10, 1 );
// Change a value Speed Optimizer is about to use
add_filter( 'sgo_bypass_cookies', function( $bypass_cookies ) {
// Change $bypass_cookies here.
return $bypass_cookies;
}, 10, 1 );Parts of a name in {braces} are filled in at runtime (for example a post type or field ID). Choose Example on any hook for a ready-to-edit snippet.
All hooks
-
sgo_bypass_cookies
filterapply_filters( 'sgo_bypass_cookies', $this->bypass_cookies ); -
sgo_bypass_query_params
filterapply_filters( 'sgo_bypass_query_params', $this->bypass_query_params ); -
sgo_exclude_urls_from_cache
filterapply_filters( 'sgo_exclude_urls_from_cache', \get_option( 'siteground_optimizer_excluded_urls', array() ) ); -
sgo_set_max_image_width
filterapply_filters( 'sgo_set_max_image_width', get_option( 'siteground_optimizer_resize_images', 2560 ) ); -
do_action( 'siteground_optimizer_flush_cache', $url ); -
do_action( 'elementor/editor/after_enqueue_styles' ); -
https_local_ssl_verify
filterapply_filters( 'https_local_ssl_verify', false ); -
apply_filters( 'sg_file_caching_preheat_url_limit', 200 ); -
sg_file_caching_preheat_xml
filterapply_filters( 'sg_file_caching_preheat_xml', get_sitemap_url( 'index' ) ); -
sgo_css_combine_exclude
filterapply_filters( 'sgo_css_combine_exclude', array_merge( $this->combined_styles_exclude_list, get_option( 'siteground_optimizer_combine_css_exclude', array() ) ) ); -
sgo_css_combine_position
filterapply_filters( 'sgo_css_combine_position', 'title' ); -
sgo_css_minify_exclude
filterapply_filters( 'sgo_css_minify_exclude', $this->css_ignore_list ); -
sgo_db_optimization_exclude
filterapply_filters( 'sgo_db_optimization_exclude', array() ); -
apply_filters( 'sgo_file_cache_allowed_vary_headers', array( 'accept-encoding', 'user-agent' ) ); -
apply_filters( 'sgo_file_cache_ignore_headers', array( 'cache-control' => 'no-cache', ) ); -
apply_filters( 'sgo_file_caching_preheat_url_list', array() ); -
sgo_google_fonts_display
filterapply_filters( 'sgo_google_fonts_display', 'swap' ); -
apply_filters( 'sgo_html_minify_exclude_params', $this->exclude_params ); -
sgo_html_minify_exclude_urls
filterapply_filters( 'sgo_html_minify_exclude_urls', get_option( 'siteground_optimizer_minify_html_exclude', array() ) ); -
sgo_ignored_query_params
filterapply_filters( 'sgo_ignored_query_params', $this->ignored_query_params ); -
apply_filters( 'sgo_javascript_combine_exclude', array_merge( $this->combined_scripts_exclude_handles, get_option( 'siteground_optimizer_combine_javascript_exclude', array() ) ) ); -
apply_filters( 'sgo_javascript_combine_exclude_all_inline', false ); -
apply_filters( 'sgo_javascript_combine_exclude_all_inline_modules', false ); -
apply_filters( 'sgo_javascript_combine_exclude_ids', $this->excluded_ids ); -
apply_filters( 'sgo_javascript_combine_exclude_move_after', $this->move_after_excludes ); -
apply_filters( 'sgo_javascript_combine_excluded_external_paths', $this->excluded_paths ); -
apply_filters( 'sgo_javascript_combine_excluded_inline_content', $this->excluded_inline_content ); -
apply_filters( 'sgo_javascript_combine_excluded_internal_paths', $this->excluded_internal_paths ); -
sgo_js_async_exclude
filterapply_filters( 'sgo_js_async_exclude', $this->blacklisted_async_scripts ); -
sgo_js_minify_exclude
filterapply_filters( 'sgo_js_minify_exclude', $this->js_ignore_list ); -
apply_filters( 'sgo_lazy_load_exclude_classes', get_option( 'siteground_optimizer_excluded_lazy_load_classes', array() ) ); -
apply_filters( 'sgo_lazy_load_exclude_post_types', array() ); -
sgo_lazy_load_exclude_urls
filterapply_filters( 'sgo_lazy_load_exclude_urls', array() ); -
sgo_pb_params
filterapply_filters( 'sgo_pb_params', array( 'fl_builder', 'vcv-action', 'et_fb', 'ct_builder', 'tve', 'preview', 'elementor-preview', 'uxb_iframe', 'trp-edit-translation', ) ); -
apply_filters( 'sgo_purge_button_capabilities', array() ); -
sgo_rqs_exclude
filterapply_filters( 'sgo_rqs_exclude', array() ); -
sgo_webp_quality
filterapply_filters( 'sgo_webp_quality', 80, $filepath ); -
sgo_webp_quality_type
filterapply_filters( 'sgo_webp_quality_type', 0 ); -
wp
actiondo_action( 'wp', $wp ); -
wp_enqueue_scripts
actiondo_action( 'wp_enqueue_scripts' );
Generated from Speed Optimizer's GPL-licensed source code. Hooks inside bundled third-party libraries are not listed.
Can't find the right hook?
We can build the customisation for you. Describe what you need: