Security Optimizer icon
Security

Security Optimizer hooks reference

  • By SiteGround
  • v1.7.0 New
  • Updated

Security Optimizer 1.7.0 has 4 actions and 10 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 Security Optimizer fires an action
add_action( 'sg_security_2fa_login_failed', function() {
	// Your code runs here.
}, 10, 1 );

// Change a value Security Optimizer is about to use
add_filter( 'login_title', function( $login_title, $title ) {
	// Change $login_title here.
	return $login_title;
}, 10, 2 );

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

  • login_title

    filter
    templates/error.php line 19
    /**
     * Filters the title tag content for login page.
     */
    apply_filters( 'login_title', $login_title, $title );
  • core/Sg_2fa/Sg_2fa.php line 431 · used in 2 places
    apply_filters( 'sg_security_2fa_do_not_challenge', true );
  • core/Sg_2fa/Sg_2fa.php line 810 · used in 2 places
    do_action( 'sg_security_2fa_login_failed' );
  • core/Sg_2fa/Sg_2fa.php line 823 · used in 2 places
    do_action( 'sg_security_2fa_login_success' );
  • core/Sg_2fa/Sg_2fa.php line 793 · used in 2 places
    do_action( 'sg_security_before_2fa_login' );
  • core/Sg_2fa/Sg_2fa.php line 638
    apply_filters( 'sg_security_2fa_block_xmlrpc', true, $user );
  • core/Helper/User_Roles_Trait.php line 22
    apply_filters( 'sg_security_2fa_roles', $roles );
  • core/Activity_Log/Activity_Log_Unknown.php line 249
    apply_filters( 'sg_security_custom_crawlers', array_merge( $this->crawlers, get_option( 'sg_security_user_crawlers', array() ) ) );
  • core/Activity_Log/Activity_Log_Unknown.php line 220
    apply_filters( 'sg_security_custom_ping_services', array_merge( $this->ping_services, get_option( 'sg_security_user_ping_services', array() ) ) );
  • core/Usernames_Service/Usernames_Service.php line 31
    apply_filters( 'sg_security_illegal_usernames', $usernames );
  • core/Activity_Log/Activity_Log_Options.php line 118
    apply_filters( 'sg_security_log_options', $log_options );
  • core/Activity_Log/Activity_Log.php line 245
    apply_filters( 'sgs_set_activity_log_lifetime', get_option( 'sgs_activity_log_lifetime', 12 ) );
  • core/Htaccess_Service/Directory_Service.php line 100
    apply_filters( "sgs_whitelist_wp_{$this->type}", $this->types[ $this->type ]['whitelist'] );

Generated from Security 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: