-
Disable non-admin users’ access to wp-admin, but allow admin-ajax
function redirect_non_admin_user(){ if ( !defined( ‘DOING_AJAX’ ) && !current_user_can(‘administrator’) ){ wp_redirect( site_url() ); exit; } } add_action( ‘admin_init’, ‘redirect_non_admin_user’ ); Reference: https://stackoverflow.com/questions/9408334/wordpress-admin-ajax-results-in-error-302-redirect https://stackoverflow.com/questions/9408334/wordpress-admin-ajax-results-in-error-302-redirect
-
Disable Comments
https://gist.github.com/mattclements/eab5ef656b2f946c4bfb