Site Kit exposes wp-login.php – How to disable OAuth button?
-
Hello,
I’m using the Google Site Kit plugin on my WordPress site, but I’m facing a significant security issue.
The Problem: The plugin adds a “Sign in with Google” button on my login page (
wp-login.php), generated by thegooglesitekit_display_login_button()function or by the scripthttps://accounts.google.com/gsi/client.The issue is that this login URL is now indexed and visible in search engines, which exposes my admin interface even though I had implemented a custom login URL to protect my site.
What I’ve tried without success:
I’ve attempted several solutions in my child theme’s
functions.phpfile:php
// Method 1: Disable via PHP add_action('login_init', function() { remove_action('login_form', 'googlesitekit_display_login_button'); add_filter('googlesitekit_login_form_enabled', '__return_false'); }, 20); add_action('login_enqueue_scripts', function() { wp_dequeue_script('google-gsi-client'); wp_deregister_script('google-gsi-client'); }, 20); // Method 2: JavaScript removal add_action('login_footer', function() { // Script to remove the button from DOM }, 999);Despite these attempts, the button still appears.
My Question: Is there an official filter or option in Google Site Kit to completely disable the Google Sign-in button on the
wp-login.phppage?If no solution exists, I will unfortunately have to deactivate the plugin, as my site’s security is compromised with the admin URL being exposed in search engines.
Thank you in advance for your help!
Configuration:
- WordPress: [6.8.3]
- Google Site Kit: [1.165.0]
- Theme: Astra Child
You must be logged in to reply to this topic.