Speed Optimizer icon
Performance & Caching

Speed Optimizer hooks reference

  • By SiteGround
  • v7.8.6
  • Updated

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.

functions.phpyour child theme
// 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

  • core/File_Cacher/File_Cacher.php line 455 · used in 2 places
    apply_filters( 'sgo_bypass_cookies', $this->bypass_cookies );
  • core/File_Cacher/File_Cacher.php line 163 · used in 2 places
    apply_filters( 'sgo_bypass_query_params', $this->bypass_query_params );
  • core/File_Cacher/File_Cacher.php line 985 · used in 2 places
    apply_filters( 'sgo_exclude_urls_from_cache', \get_option( 'siteground_optimizer_excluded_urls', array() ) );
  • core/Images_Optimizer/Images_Optimizer.php line 212 · used in 2 places
    apply_filters( 'sgo_set_max_image_width', get_option( 'siteground_optimizer_resize_images', 2560 ) );
  • core/Supercacher/Supercacher.php line 283 · used in 2 places
    do_action( 'siteground_optimizer_flush_cache', $url );
  • core/Front_End_Optimization/Front_End_Optimization.php line 373
    do_action( 'elementor/editor/after_enqueue_styles' );
  • core/Images_Optimizer/Abstract_Images_Optimizer.php line 64
    apply_filters( 'https_local_ssl_verify', false );
  • core/File_Cacher/File_Cacher.php line 1231
    apply_filters( 'sg_file_caching_preheat_url_limit', 200 );
  • core/File_Cacher/File_Cacher.php line 782
    apply_filters( 'sg_file_caching_preheat_xml', get_sitemap_url( 'index' ) );
  • core/Combinator/Css_Combinator.php line 160
    apply_filters( 'sgo_css_combine_exclude', array_merge( $this->combined_styles_exclude_list, get_option( 'siteground_optimizer_combine_css_exclude', array() ) ) );
  • core/Combinator/Css_Combinator.php line 265
    apply_filters( 'sgo_css_combine_position', 'title' );
  • core/Minifier/Minifier.php line 300
    apply_filters( 'sgo_css_minify_exclude', $this->css_ignore_list );
  • core/Database_Optimizer/Database_Optimizer.php line 252
    apply_filters( 'sgo_db_optimization_exclude', array() );
  • core/Helper/File_Cacher_Trait.php line 433
    apply_filters( 'sgo_file_cache_allowed_vary_headers', array( 'accept-encoding', 'user-agent' ) );
  • core/Helper/File_Cacher_Trait.php line 497
    apply_filters( 'sgo_file_cache_ignore_headers', array( 'cache-control' => 'no-cache', ) );
  • core/File_Cacher/File_Cacher.php line 774
    apply_filters( 'sgo_file_caching_preheat_url_list', array() );
  • core/Combinator/Fonts_Optimizer.php line 225
    apply_filters( 'sgo_google_fonts_display', 'swap' );
  • core/Minifier/Minifier.php line 415
    apply_filters( 'sgo_html_minify_exclude_params', $this->exclude_params );
  • core/Minifier/Minifier.php line 385
    apply_filters( 'sgo_html_minify_exclude_urls', get_option( 'siteground_optimizer_minify_html_exclude', array() ) );
  • core/File_Cacher/File_Cacher.php line 921
    apply_filters( 'sgo_ignored_query_params', $this->ignored_query_params );
  • core/Combinator/Js_Combinator.php line 645
    apply_filters( 'sgo_javascript_combine_exclude', array_merge( $this->combined_scripts_exclude_handles, get_option( 'siteground_optimizer_combine_javascript_exclude', array() ) ) );
  • core/Combinator/Js_Combinator.php line 795
    apply_filters( 'sgo_javascript_combine_exclude_all_inline', false );
  • core/Combinator/Js_Combinator.php line 802
    apply_filters( 'sgo_javascript_combine_exclude_all_inline_modules', false );
  • core/Combinator/Js_Combinator.php line 741
    apply_filters( 'sgo_javascript_combine_exclude_ids', $this->excluded_ids );
  • core/Combinator/Js_Combinator.php line 869
    apply_filters( 'sgo_javascript_combine_exclude_move_after', $this->move_after_excludes );
  • core/Combinator/Js_Combinator.php line 894
    apply_filters( 'sgo_javascript_combine_excluded_external_paths', $this->excluded_paths );
  • core/Combinator/Js_Combinator.php line 859
    apply_filters( 'sgo_javascript_combine_excluded_inline_content', $this->excluded_inline_content );
  • core/Combinator/Js_Combinator.php line 908
    apply_filters( 'sgo_javascript_combine_excluded_internal_paths', $this->excluded_internal_paths );
  • core/Front_End_Optimization/Front_End_Optimization.php line 226
    apply_filters( 'sgo_js_async_exclude', $this->blacklisted_async_scripts );
  • core/Minifier/Minifier.php line 145
    apply_filters( 'sgo_js_minify_exclude', $this->js_ignore_list );
  • core/Lazy_Load/Abstract_Lazy_Load.php line 62
    apply_filters( 'sgo_lazy_load_exclude_classes', get_option( 'siteground_optimizer_excluded_lazy_load_classes', array() ) );
  • core/Lazy_Load/Abstract_Lazy_Load.php line 116
    apply_filters( 'sgo_lazy_load_exclude_post_types', array() );
  • core/Lazy_Load/Abstract_Lazy_Load.php line 97
    apply_filters( 'sgo_lazy_load_exclude_urls', array() );
  • sgo_pb_params

    filter
    core/Helper/Helper.php line 59
    apply_filters( 'sgo_pb_params', array( 'fl_builder', 'vcv-action', 'et_fb', 'ct_builder', 'tve', 'preview', 'elementor-preview', 'uxb_iframe', 'trp-edit-translation', ) );
  • core/Admin/Admin_Bar.php line 24
    apply_filters( 'sgo_purge_button_capabilities', array() );
  • core/Front_End_Optimization/Front_End_Optimization.php line 319
    apply_filters( 'sgo_rqs_exclude', array() );
  • core/Images_Optimizer/Images_Optimizer_Webp.php line 142
    apply_filters( 'sgo_webp_quality', 80, $filepath );
  • core/Images_Optimizer/Images_Optimizer_Webp.php line 143
    apply_filters( 'sgo_webp_quality_type', 0 );
  • wp

    action
    core/Front_End_Optimization/Front_End_Optimization.php line 371
    do_action( 'wp', $wp );
  • core/Front_End_Optimization/Front_End_Optimization.php line 372
    do_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: