• Resolved mirabolamente

    (@mirabolamente)


    Hi, please, I would like to know how to exclude login page from being cached. I use?All In One WP Security: I renamed the login page to the site for security reasons, but to avoid brute force attacks it is necessary to exclude the URL from the cache, the authors of the theme confirmed this to me. Initially, I just added a string because I was using the hosting cache plugin, but to increase the performance of the site I installed Autoptimize which absolutely works better. Without this measure, from the moment of installing the cache plugin there are daily access attempts. Thanks!

Viewing 1 replies (of 1 total)
  • Plugin Author Optimizing Matters

    (@optimizingmatters)

    well, to be clear; Autoptimize does not cache pages (although AO Pro can), it just optimizes the CSS & JS & images of a given page and will typically not optimize the login page either.

    if you however want to explicitly exclude the renamed login page from being optimized, you can use a code snippet like in the example below where the login would be at /my-renamed-login;

    add_filter( 'autoptimize_filter_noptimize', 'mira_ao_noptimize', 10, 1 );
    function mira_ao_noptimize( $flag_in ) {
    	if ( strpos( $_SERVER['REQUEST_URI'], 'my-renamed-login' ) !== false ) {
    		return true;
    	} else {
    		return $flag_in;
    	}
    }

    hope this helps,
    frank

Viewing 1 replies (of 1 total)
  • The topic ‘How to exclude WP login page from being cached’ is closed to new replies.